2

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?

2
  • Gotta love corporate environments.
    – hawkke
    CommentedFeb 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) hillsCommentedFeb 17, 2012 at 22:15

3 Answers 3

9

ASP.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.

0
    4

    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?

    1
    • Thanks for the answer :-). In my case the 'conservative' company I work for does not want to depend on any plugins, therefore we have to write everything from scratch.CommentedApr 22, 2013 at 20:47
    0

    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.

      Start asking to get answers

      Find the answer to your question by asking.

      Ask question

      Explore related questions

      See similar questions with these tags.