Friday, February 10, 2012

ASP.NET MVC 3 Problem: Ajax.ActionLink and Ajax.BeginForm opens in new page




  
Free Lessons for Chruch Pianists:
Free lessons, tips and downloads for church pianists

DVD Courses (Reharmonization, Play by Ear!, Arranging, Accompanying, Theory for Church Pianists, etc.):
Over 30 hours of DVD instruction for church pianists
 



How to solve this problem:


In web.config file:

<configuration>
  <appSettings>
...
    <add key="UnobtrusiveJavaScriptEnabled" value="true"/>
  </appSettings>
...
</configuration>




 In your _Layout.cshtml:

 <script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script>

NOTE: CHECK THE VERSION OF YOUR jquery-[version].js FILE




In your *.cshtml file or _Layout.cshtml:

<script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"> </script>


---