admin管理员组文章数量:1315346
I need to write an application in ASP.NET MVC, but for corporate reasons I can't use jQuery. I have heard that you can "turn off" jQuery and that ASP.NET controls like TextBoxFor will fall back to using Microsoft's older JS libraries. But I haven't found any detailed information on how to do this.
Anyone have experience with this approach? Any pointers?
I need to write an application in ASP.NET MVC, but for corporate reasons I can't use jQuery. I have heard that you can "turn off" jQuery and that ASP.NET controls like TextBoxFor will fall back to using Microsoft's older JS libraries. But I haven't found any detailed information on how to do this.
Anyone have experience with this approach? Any pointers?
Share Improve this question asked Feb 17, 2012 at 20:17 Mike KantorMike Kantor 1,4545 gold badges27 silver badges46 bronze badges 2- Gotta love corporate environments. – hawkke Commented Feb 17, 2012 at 21:38
- i can understand (sort of), no javascript. how that then subverts to no jquery reeks of corporate misunderstanding and total ignorance (imho). but hey, there's gold in them there (blighted) hills – jim tollan Commented Feb 17, 2012 at 22:15
3 Answers
Reset to default 9ASP.NET MVC does not require jQuery. The MVC3 project templates include it in _Layout.cshtml
because many developers prefer it. You can remove it.
It does use jQuery Validation by default, however, but you can use the Microsoft Ajax MVC2 libraries instead.
If you remove jQuery scripts, you will be unable to use the jQuery/Unobtrusive MVC 3 validation.
Use the MS scripts and corresponding validation functionality instead:
_Layout.cshtml:
"~/Scripts/MicrosoftAjax.js"
"~/Scripts/MicrosoftMvcValidation.js"
That’s all.
By the way, why cannot you use the jQuery in your project?
It's all down to the adapters that you decide to include from the default script folders. If you don't want to use Jquery include the other adapter files.
本文标签: javascriptUsing ASPNET MVC 3 **WITHOUT** jQueryStack Overflow
版权声明:本文标题:javascript - Using ASP.NET MVC 3 **WITHOUT** jQuery - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741976210a2408137.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论