开发者

ScriptManager loads multiple java scripts in asp.net ? i need them to be all in one as per YSlow guidelines

开发者 https://www.devze.com 2022-12-17 18:22 出处:网络
As per Yahoo\'s guidelines for performance of web sites , javascripts should be combined in one to avoid extrahttp request , as i saw in YSlo开发者_如何学编程w asp.net loads 3 to 4 scripts one for Mic

As per Yahoo's guidelines for performance of web sites , javascripts should be combined in one to avoid extra http request , as i saw in YSlo开发者_如何学编程w asp.net loads 3 to 4 scripts one for MicrosoftAjax.js , one for microsoft MicrosoftAjaxForms.js & some other 2 which may tondle postbacks & client side validations , I want these 4 js to be in one.

there are 4

Please tell me how to do i achieve this ?

Thanks .


You might want to take a look at the ScriptManager - CompositeScript feature... http://msdn.microsoft.com/en-us/library/cc488552.aspx
which can be used like this:

<asp:ScriptManager runat=”server” ID=”ScriptManager1”>
<CompositeScript>
    <Scripts>
        <asp:ScriptReference Name=”MicrosoftAjax.js” />
        <asp:ScriptReference Name=”MicrosoftAjaxWebForms.js” />
    </Scripts>
</CompositeScript>

Note that this is an ASP.NET 3.5 feature.. so if you are using at least 3.5, you will have access to this..


I recommend you read this article which talks about the same thing you've asked.

http://www.codeproject.com/KB/aspnet/fastload.aspx

0

精彩评论

暂无评论...
验证码 换一张
取 消