.Ajax with jQuery and MVC2

Posted by Mario on Stack Overflow See other posts from Stack Overflow or by Mario
Published on 2010-03-26T15:09:08Z Indexed on 2010/03/26 15:13 UTC
Read the original article Hit count: 743

Filed under:
|
|

Im trying to create an ajax (post) event that will populate a table in a div on button click.

I have a list of groups, when you click on a group, I would like the table to "disappear" and the members that belong to that group to "appear".

My problem comes up when using jQuery's .ajax...

When I click on the button, it is looking for a controller that doesnt exist, and a controller that is NOT referenced. I am, however, using AREAS (MVC2), and the area is named Member_Select where the controller is named MemberSelect. When I click on the button, I get a 404 stating it cannot find the controller Member_Select. I have examined the link button and it is set to Member_Select when clicked on, but here's the ajax call:

$.ajax({
    type: "POST",
    url: '/MemberSelect/GetMembersFromGroup',
    success: function(html) { $("#groupResults").html(html); }
});

I havent been able to find any examples/help online. Any thoughts/suggestions/hints would be greatly appreciated.

Thanks!

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about jQuery