I am new to both MVC and JQuery, but this should not really be that difficult. When I call the function, nothing happens. I put an alert box in the function, and I can see that the function is called.
I found this, but it did not help me: Calling ASP.NET MVC Action Methods from JavaScript
This is my script:
<script type="text/javascript">
function oKButtonPressed(){
jQuery.ajax({
type: "POST",
url: "@Url.Action("MessageToPatient", "StartScreen")"
});
};
</script>
MessageToPatient
is the name of the action method. StartScreen
is the name of the controller.
Can you see something obvious I'm missing? Otherwise, it might be something with my MVC code.