Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC without MicrosoftAjax.js and MicrosoftMvcAjax.js

What parts of functionality will I lose after removing the

MicrosoftAjax.js

MicrosoftMvcAjax.js

files?

I don't want to use them for various reasons and I thought if there were any 3rd party helper methods that would mimic existing ones but are tied to another JavaScript framework, such as jQuery.

Also, please tell where usage of above javaScript files is preferrable/adviced.

Many thanks,

Valentin Vasiliev.

like image 769
Valentin V Avatar asked Feb 07 '09 19:02

Valentin V


1 Answers

You won't be able to use the AjaxHelper extension methods (in the System.Web.Mvc.Ajax namespace) that are exposed by the Ajax property on the ViewPage class if you don't refer to the MicrosoftAjax scripts. They're relatively easy to replace by using the appropriate jQuery AJAX methods ($.post, $.get, $(selector).load etc) or the jQuery form plugin.

As for whether one or another is preferable or not it's down to how comfortable you are with writing your own implementation. The Ajax helper methods try to take care of a lot of things for you in terms of client script programming but that comes at a price of having to load in the pretty heavyweight MS AJAX library. Rolling your own javascript methods can lead to more lightweight code as well as providing you with a choice of javascript library to use (be it jQuery or one of the many others out there).

like image 142
John Foster Avatar answered Oct 26 '22 21:10

John Foster