14

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
  • 270,886
  • 87
  • 504
  • 504
Zilberman Rafael
  • 1,341
  • 2
  • 14
  • 45
  • 3
    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 Jan 04 '14 at 11:33
  • @BenjaminGruenbaum If so, why the SPA template in VS2013 not making usage of `unobtrusive AJAX`? – Zilberman Rafael Jan 04 '14 at 12:43
  • 1
    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 :) – Benjamin Gruenbaum Jan 04 '14 at 12:55
  • @BenjaminGruenbaum So I shouldn't use the codes from the templates? This is the only way to understand how to use MVC 5 authorization because the books will come out only in March. – Zilberman Rafael Jan 04 '14 at 15:36
  • @Rafael Are you Dov's son? – Shimmy Weitzhandler Mar 31 '15 at 02:58

1 Answers1

27

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.

Eilon
  • 25,582
  • 3
  • 84
  • 102