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 casejquery.unobtrusive-ajax
) not recommended for use so I don't using it. I prefer manually writeAJAX
requests usingJQuery
."
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?
The idea behind Unobtrusive AJAX is that AJAX behaviour is attached to form and anchor elements via HTML5 data-* attributes, instead of binding click event handlers in script blocks. In old MVC, these attributes can be generated from Html helpers: Ajax. BeginForm and Ajax. ActionLink and then setting some AjaxOptions .
The MVC Framework contains built-in support for unobtrusive Ajax. You can use the helper methods to define your Ajax features without adding a code throughout all the views. This feature in MVC is based on the jQuery features. To enable the unobtrusive AJAX support in the MVC application, open the Web.
It is a client-side script that communicates to and from a server/database without the need for a postback or a complete page refresh. The Ajax speeds up response time. In other words, Ajax is the method of exchanging data with a server, and updating parts of a web page, without reloading the entire page.
Unobtrusive JavaScript is a general term that conveys a general set of guidelines or margins to the term REST. REST is nothing but the Representational State Transfer. We can explain Unobtrusive JavaScript as- it is not your particular JavaScript code that you generally use in your markup page.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With