I have a button like this:
<button id="CreateButton" title="Create Task">Create Task</button>
I wrote code to capture the click event:
$('#CreateButton').click(function (event) {
event.preventDefault
var datastore = $("#SelectedDatastore").val();
xxxxxx
});
But I want make the clicking call an action method on my MVC controller with some parameters. For example the paramater and value of datastore.
If you just want to go to another page, you could change the location:
Or if you don’t want to change the current page, but just to execute an action, use jQuery.get()