本文介绍了ASP.NET MVC 3和jquery.unobtrusive,ajax.min.js的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述 我想使用的Ajax.ActionLink HTML辅助,因此我需要jquery.unobtrusive-ajax.min.js库,但IE浏览器总是显示此错误:I've read that the solution is usage of jquery.validate.min.js and jquery.validate.unobtrusive.min.js but then I can't recognise the ajax call on server side. 解决方案 No, those 2 script have nothing to do with jquery.unobtrusive-ajax.min.js. They are used for unobtrusive validation. For Ajax.* helpers all you need is jQuery and jquery.unobtrusive-ajax.min.js (included in THAT order).So for unobtrusive AJAX you need:<script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"></script><script src="@Url.Content("~/Scripts/jquery.unobtrusive-ajax.min.js")" type="text/javascript"></script>If you want to use unobtrusive validation you could also include the 2 scripts afterwards (in THAT order):<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script><script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>Another very important thing that you should make sure is that you have removed absolutely any traces of Microsoft*.js scripts from your project. Those scripts are obsolete and starting from ASP.NET MVC 3 are no longer used by default. Also make sure that youhave enabled unobtrusive AJAX in your web.config, otherwise the system will fallback to the legacy Microsoft ajax scripts:<appSettings> <add key="webpages:Version" value="1.0.0.0"/> <add key="ClientValidationEnabled" value="true"/> <add key="UnobtrusiveJavaScriptEnabled" value="true"/></appSettings> 这篇关于ASP.NET MVC 3和jquery.unobtrusive,ajax.min.js的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!
10-14 19:20