ScriptCombining Feature

by UnquaLe 7. March 2008 19:01

I was reading the post (Mix08 Session Overview: Building Great AJAX Applications from Scratch Using ASP.NET 3.5 and Visual Studio 2008) from Brad Abrams then I have seen very cool feature to combine the scripts into a single request that saves the round trip and compresses better.

The text is from his post;

Download the completed sample or just the starter files to play along at home. 

We can use the new ScriptCombining feature to combing the scripts into a single request that saves the round trip time and compresses better.

But first we need to know exactly what scripts are being loaded.  To see this let's look at the ScriptReference debugging tool.

Just drop it on your page

	    <cc2:ScriptReferenceProfiler ID="ScriptReferenceProfiler1" runat="server" /> 
	

and you see exactly what is loaded.

		
	

image

We also, have both the debug and retail scripts ready to download in case we want to share this across several pages.

Then cut and past that into ScriptManager.

			<asp:ScriptManager runat="server" ID="sm">
	<CompositeScript>
	<Scripts>
	<asp:ScriptReference Name="MicrosoftAjax.js" />
	<asp:ScriptReference Name="MicrosoftAjaxWebForms.js" />
	<asp:ScriptReference Name="AjaxControlToolkit.Common.Common.js" 
	Assembly="AjaxControlToolkit, Version=3.0.11119.25533, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
	<asp:ScriptReference Name="AjaxControlToolkit.ExtenderBase.BaseScripts.js" 
	Assembly="AjaxControlToolkit, Version=3.0.11119.25533, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
	<asp:ScriptReference Name="AjaxControlToolkit.TextboxWatermark.TextboxWatermark.js"
	Assembly="AjaxControlToolkit, Version=3.0.11119.25533, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
	<asp:ScriptReference Name="AjaxControlToolkit.Rating.RatingBehavior.js" 
	Assembly="AjaxControlToolkit, Version=3.0.11119.25533, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
	<asp:ScriptReference Name="AjaxControlToolkit.Compat.Timer.Timer.js" 
	Assembly="AjaxControlToolkit, Version=3.0.11119.25533, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
	<asp:ScriptReference Name="AjaxControlToolkit.Animation.Animations.js" 
	Assembly="AjaxControlToolkit, Version=3.0.11119.25533, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
	<asp:ScriptReference Name="AjaxControlToolkit.Animation.AnimationBehavior.js" 
	Assembly="AjaxControlToolkit, Version=3.0.11119.25533, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
	<asp:ScriptReference Name="AjaxControlToolkit.PopupExtender.PopupBehavior.js" 
	Assembly="AjaxControlToolkit, Version=3.0.11119.25533, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
	<asp:ScriptReference Name="AjaxControlToolkit.AutoComplete.AutoCompleteBehavior.js"
	Assembly="AjaxControlToolkit, Version=3.0.11119.25533, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
	<asp:ScriptReference Name="AjaxControlToolkit.ConfirmButton.confirmButtonBehavior.js"
	Assembly="AjaxControlToolkit, Version=3.0.11119.25533, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e" />
	</Scripts>
	</CompositeScript>
	</asp:ScriptManager>
	

Now, let's go back to firebug...

image

This time, we have two request 118KB and 4.39s... Much better!

 

Tags:

Comments

3/7/2008 7:24:24 PM #

trackback

Trackback from DotNetKicks.com

ScriptCombining Feature

DotNetKicks.com | Reply

8/28/2010 8:09:46 PM #

oil paintings

Resources like the one you mentioned here will be very useful to me! I will post a link to this page on my blog. I am sure my visitors will find that very useful.

oil paintings United States | Reply

3/8/2008 12:26:01 AM #

Mustafa

Nice

Mustafa Turkey | Reply

8/28/2010 8:07:00 PM #

oil paintings

Thanks for another informative blog. Where else could you obtain this information is written so perfect? I have a project that I am now working, and I realized that information.

oil paintings United States | Reply

8/31/2010 8:33:57 PM #

Replica Rolex Watches

A good blog, I like! Welcome to our website to find your favorite watch, click on my name! Look forward to your visit! Thank you!

Replica Rolex Watches United States | Reply

9/1/2010 5:24:06 AM #

Nude Cam

Hey, great blog...I'll add your site in my rss reader, if I can figure out how to get it to work...LOL

Nude Cam United States | Reply

9/1/2010 12:48:43 PM #

Risa Dorset

Thanks for posting some great information, ive already bookmarked your blog and have shared the link with a few of my friends, so youve got yourself some regular readers.

Risa Dorset United States | Reply

9/1/2010 1:30:20 PM #

Blogging to the Bank 2011

Beautiful theme. I am just starting out learning about Blogengine so seeing themes and info like this is very helpful.

Blogging to the Bank 2011 United States | Reply

9/2/2010 5:37:38 AM #

Industrial Power Cable

I really appreciate the author. I really enjoyed while reading the

post... Thank you so much for sharing the post with all...

Industrial Power Cable U.A.E. | Reply

9/2/2010 9:39:41 AM #

Holly Feierman

Thank you for sharing. I enjoy reading great blogs like this one.

Holly Feierman United States | Reply

9/2/2010 2:19:44 PM #

jordan shoes

Very interesting blog. Alot of blogs that I see these days don't really offer anything that I'm interested in, but I'm definately interested in this blog. Just thought that I would pass that message on.

jordan shoes United States | Reply

9/2/2010 7:43:14 PM #

Capacitor for 250W MH - Floralux, 15uf/400v

Wonderful blog! coming from an intelligent person like you.
Thanks for this post. It's a big help.

Capacitor for 250W MH - Floralux, 15uf/400v United States | Reply

9/3/2010 9:30:21 AM #

military style jacket

Nicely written posts.  Your style is very engaging and the information is very helpful.  Keep writing such interesting and useful posts.

military style jacket United States | Reply

9/3/2010 1:45:52 PM #

Nude Cam

lol a couple of the reviews bloggers write are just silly and unrelated, sometimes i wonder whether they at all read the post before writing or whether they merely look at the subject of the post and write the very first thought that comes to their minds. But it is nice to find a fresh commentary every now and then in contrast to the exact same, traditional blog garbage which I oftentimes notice on the blogs. Cheers

Nude Cam United States | Reply

9/4/2010 5:23:45 AM #

Bradley

Found your site whilst searching with bing and they have really delivered this time. The words contained within this webpage, is not only very well written but gives the reader exactly what they are looking for.
Excellent post, thank you for sharing!

Bradley Bulgaria | Reply

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading