This will be a second part of ASP.NET 4.0 Script Manager enhancement. In this post I am going to explain about AjaxFrameworkMode Property. In Earlier asp.net version of script manager it will load entire Microsoft Ajax library whether its required or not. In asp.net 4.0 script manager we are having AjaxFrameMode property where we can set mode as explicit and we add only js that are required or not.
There are three values of AjaxFrameworkMode properties supported in asp.net
- Enabled- Specified that ASP.NET 4.0 scriptmanager will automatically load MicrosoftAjax.js file which is core element of Microsoft Ajax library.
- Explicit- Specifies that you will explicitly include script references to individual framework core script file that your page requires, and that you will include references to the dependencies that each script file requires.
So here is example if require only Microsoftcore.js then we can use this explicitly without loading other unnecessary files.
<asp:ScriptManager ID="myScirptManager" AjaxFrameworkMode="Explicit" runat="server"> <Scripts> <asp:ScriptReference Name="MicrosoftAjaxCore.js" /> </Scripts> </asp:ScriptManager>
Hope this will help you increase your performance. Stay tuned for more..