Ajax.BeginForm results in redirect to partial view instead of in-place

前端 未结 2 1610
一向
一向 2021-01-22 12:42

My Search.cshtml has a div named \"search-results\" that is to be updated. SearchResults is the action name. I have done this many times on MVC2/VS2008 projects, but this is my

2条回答
  •  日久生厌
    2021-01-22 13:25

    You forgot to include the jquery.unobtrusive-ajax.js script to your page (adjust the path as necessary):

    
    

    As far as Microsoft*.js scripts are concerned, they are obsolete in ASP.NET MVC 3 and should no longer be used unless you are porting some legacy application. They have been replaced by jQuery.

提交回复
热议问题