Is it recommended to use unobtrusive AJAX with MVC 5?

11,026

The Unobtrusive Validation and AJAX support in ASP.NET MVC follow many best practices that enable Progressive Enhancement and are also super easy to use. The unobtrusive AJAX library (not the unobtrusive validation library) is admittedly a bit limited in functionality, but if it satisfies the requirements of the application you are writing, then by all means use it. And because the source code of it is in your app (it's JavaScript, after all), it's generally straightforward to make any updates or changes to it as you see fit.

If someone wants to write everything manually, they are welcome to write assembly code to solve all their problems. Or just etch 1's and 0's onto a DVD with a laser pointer.

Share:
11,026

Related videos on Youtube

Zilberman Rafael
Author by

Zilberman Rafael

Chinese sage once said to me: This is a trade-off between speed and memory, and is a VERY common trade-off you find people dealing with. Personally I think speed is more important than memory in modern 32 and 64 bit processors.

Updated on June 04, 2022

Comments

  • Zilberman Rafael
    Zilberman Rafael almost 2 years

    I know that there is library that supports unobtrusive AJAX so I asked my father (also .net programmer) why he don't use it and his answer was very surprising for me:

    "The unobtrusive AJAX (in your case jquery.unobtrusive-ajax) not recommended for use so I don't using it. I prefer manually write AJAX requests using JQuery."

    I searched around the internet but I can't find place that saying that unobtrusive AJAX is not recommended for use.

    So is there any problem with the usage of jquery.unobtrusive-ajax and MVC AJAX helpers? If so, Can you say what is the problem and is it fixable?

    • Benjamin Gruenbaum
      Benjamin Gruenbaum over 10 years
      Some people don't like having HTML magically generated for them. Stuff like unobtrusive AJAX (and even things like EditorFor) mean you're writing code in one language and debugging it in another. Some people don't like that.
    • Benjamin Gruenbaum
      Benjamin Gruenbaum
      A lot of templates in visual studio and more generally Microsoft tutorials and resources are bad. You get to know the trustworthy bloggers/resources eventually don't worry :)