MVC 3 Razor - Ajax.BeginForm OnSuccess

后端 未结 4 1800
忘了有多久
忘了有多久 2020-12-21 06:00

I\'m new to MVC and I\'m trying to update my page after I submit my form; but it\'s not working. I\'m only trying to hide the form, and show the contents of a div OnSuccess

4条回答
  •  被撕碎了的回忆
    2020-12-21 06:19

    Are you sure you have all the correct js files referenced in your project? In MVC3, they have moved away from the MS Ajax files. If I remember right - the unobtrusive javascript should be enabled by default, so you should reference the following files: jquery.js, jquery.validate.js, jquery.valudate.unobtrusive.js, jquery.unobtrusive-ajax.js

    With these files references - you should be fine.

    P.S. There's a very good blog post by Brad Wilson explaining the details of unobtrusive ajax in MVC3, and how it all works. Check it out here: http://bradwilson.typepad.com/blog/2010/10/mvc3-unobtrusive-ajax.html

提交回复
热议问题