MVC - Using Ajax to render partial view MVC - Using Ajax to render partial view ajax ajax

MVC - Using Ajax to render partial view


When you use this:

<a href="javascript:document.forms[0].submit()">

...you should be aware that it's not the same as

<input type="submit" />

It doesn't raise the onsubmit event, and MVC's AJAX eventhandler is not called.

To confirm this is the issue, add

<input type="submit" /> 

inside the form and try it out.

Finally, just call onsubmit() from your link

<a href="#" onclick="document.forms[0].onsubmit()">


Might be worth ensuring that you have correctly referenced the ajaxmvc and jquery scripts in your page (master page). If these are incorrect a new page will be displayed instead of the correct output in the target div.


RenderPartial takes an action name, not the name of the user control, so replace "IngredientsListControl" with "UpdateStep2", your action name.