AjaxFrameworkMode Property with ScriptManager in ASP.NET 4.0-Part 2

Posted By  jalpesh On 20 Dec 2010 07:12:43
emailbookmarkadd commentsprint
No of Views:791
Bookmarked:0 times
Votes:0 times

Introduction

This is second part of the ScriptManager in ASP.NET 4.0.In this tip I am going to explain about AjaxFrameworkMode Property for ScriptManager in ASP.NET 4.0.The ASP.NET 4.0 has lots of ways to increase performance with AJAX.

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.
Disabled- This Specified that Microsoft Ajax Script features are disabled and script manager will not have any reference to any javascript files.
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.

Html Code

<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..

Sign Up to vote for this article
Other popular Tips/Tricks
Comments
There is no comments for this articles.
Leave a Reply
Title:
Display Name:
Email:
(not display in page for the security purphase)
Website:
Message:
Please refresh your screen using Ctrl+F5
If you can't read this number refresh your screen
Please input the anti-spam code that you can read in the image.
^ Scroll to Top