1

I am using jQuery and jQuery UI across my project with HtmlHelper extensions. And somehow the advantages of using the AjaxHelper has eluded me.(or maybe I'm ignorant) I was just curious to know what are the uses of the AjaxHelper class in asp.net mvc. and whether its really worth incorporating into my project.

Can some one point out some obvious advantages since I find myself comfortable without its use but not-so-comfortable for not exploring it fully.

1 Answer 1

3

AjaxHelper is the same as HtmlHelper except that it pollutes your html code with MS AJAX specific javascript (like onclick="some very ugly code that performs an AJAX request and handles the result"). So if you are using jquery, I would strongly recommend you to never think about AjaxHelper. By the way starting from ASP.NET MVC 3, the MS AJAX is replaced by jquery as default framework and the AjaxHelper produce clean markup and handlers are attached unobtrusively.

Sign up to request clarification or add additional context in comments.

2 Comments

Yes, I am using asp.net mvc3.
Well then the AjaxHelper will use HTML5 data-* attributes to indicate unobtrusively the actions that need to be performed. For example it could generate the following link: <a data-ajax="true" data-ajax-mode="replace" data-ajax-update="#foo" href="/Home/About">test link</a> and then if you include the jquery.unobtrusive-ajax.js to your project it will work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.