How to use the IHttpAsyncHandler in ASP.NET

by UnquaLe 30. June 2008 18:34

Before reading this post you have to know what IHttpHandler intaface does.

Basically, the IHttpAsyncHandler interface allows you to serve content asynchronously from a HTTP handler. This is great when you need to free up the worker thread to do processing like IO work etc. ASP.NET actually uses fewer threads when it runs asynchronously, which is great for performance and scalability. That’s because each thread is returned much faster to the thread pool.

There you are a simple example.

Tags:

Live Alerts with AJAX and AJAX 3.5 Extender Controls

by UnquaLe 2. May 2008 18:46

If you don't know Live Alert SDK, you don't know how to alert your users in a cool way ! Then you want to see it. There are some cool articles that you would like to see;

Alerting Your Users with Live Alerts and ASP.NET AJAX

Building ASP.NET 3.5 AJAX Extender Controls

 

Tags:

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:

How to provide user management for your online site

by UnquaLe 3. March 2008 23:15

As you know, ASP.NET Web Administration Tool works locally only.  In this article you will know how to get it working with the remote websites too. It recommends 2 option for that.

So lets read it. 

Tags:

ASP.NET MVC Framework

by UnquaLe 22. October 2007 19:26
ScottGu had presented the new ASP.NET MVC Framework as a prototype last week in ALT.NET Conference.

Ultimately this is a group that believes in:

  • Continuous Learning
  • Being Open to Open Source Solutions
  • Challenging the Status Quo
  • Good Software Practices
  • DRY (Don't Repeat Yourself)
  • Common Sense when possible

It enables Test Driven Development by default. You can unit test the application without having to run the controllers within an ASP.NET process. You can use any unit-testing framework such as NUnit, NBUnit.

You can extend the framework by writing your own view engine. And the most amazing feature is to be pluggable. You can use any existing Dependency Injection and IOC container models such as Windsor, Spring.Net, NHibernate, etc.

You don't need URL-Rewriting frameworks anymore you can handle this process in your Controller classes. Your URLs will be SEO friendly easly.

These features and design choices represent a huge paradigm shift for Microsoft. They say to the open source .NET community: “We recognize your contributions, and we’re not going to try and reinvent what you’ve done. Instead, we’re going to make it pluggable, so you can use whatever technology you favor.”

It looks like Patterns & Practice team had really good job!. I wish i could be in this conference :( what a shame ! 

To watch The Gu and Scott Hanselman follow the link.

Thanks Guys !

Doga

Tags: , ,