using Ajax for partial view loading in .NET MVC4
- ditch
#
inUpdateTargetId = "#mainDiv"
- make sure you have
jquery.unobtrusive-ajax.min.js
script referenced on your page.
I copied your code into a brand new MVC4 project and it works fine.
See screenshot of the solution:
Hope this will give you a hint on what could be wrong.
I typically load partials like this using JQuery
$( document ).ready(function() { $("#lnkPage1").click(function( event ) { $('#mainDiv').load('Test/Pag1'); }); $("#lnkPage2").click(function( event ) { $('#mainDiv').load('Test/Pag2'); });});