How to use ajax in mvc?
I am a very beginner to mvc and ajax both.
I have tried many examples on net but I don't understand how ajax is used
practically?
I have a controller named members which has GetAllMembers Method.
GetAllMembers returns a List<Members>
Now I want to use JQuery and ajax something like :
$(document).click(function () {
$.ajax({
url: "Members/GetAllMembers",
success: function () {
},
error: function () {
alert("Failed to get the members");
}
});
});
Is my URL right?
Upon success I want to display that List in a ListBox. How can I get it?
Can anyone give me a start?
No comments:
Post a Comment