<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:copyright="http://blogs.law.harvard.edu/tech/rss" xmlns:image="http://purl.org/rss/1.0/modules/image/">
    <channel>
        <title>Tips/Tricks</title>
        <link>http://geekswithblogs.net/rashid/category/6047.aspx</link>
        <description>Tips/Tricks</description>
        <language>en-US</language>
        <copyright>Kazi Manzur Rashid</copyright>
        <managingEditor>kazimanzurrashid@yahoo.com</managingEditor>
        <generator>Subtext Version 0.0.0.0</generator>
        <item>
            <title>Compress Asp.net Ajax Web Service Response - Save Bandwidth</title>
            <link>http://geekswithblogs.net/rashid/archive/2007/09/15/Compress-Asp.net-Ajax-Web-Service-Response---Save-Bandwidth.aspx</link>
            <description>&lt;p&gt;In this post, I will show you how to compress the Asp.net Ajax Web Service response, To understand the benefits of compression let us start with a simple example, Consider you have an web service which returns a large data like the following:&lt;/p&gt;&lt;pre class="code"&gt;[&lt;span style="color: rgb(43,145,175)"&gt;WebMethod&lt;/span&gt;()]
&lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; GetLargeData()
{
    &lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; (&lt;span style="color: rgb(43,145,175)"&gt;StreamReader&lt;/span&gt; sr = &lt;span style="color: rgb(43,145,175)"&gt;File&lt;/span&gt;.OpenText(Server.MapPath(&lt;span style="color: rgb(163,21,21)"&gt;"~/DataFile.txt"&lt;/span&gt;)))
    {
        &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; sr.ReadToEnd();
    }
}&lt;/pre&gt;
&lt;p&gt;The web method reads an large text file (around 100KB) and returns it contents. Once we call this method from a page the network activity in the firebug shows like the following:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Plain" src="http://geekswithblogs.net/images/geekswithblogs_net/rashid/7075/r_Plain.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;Now, lets examine the &lt;font face="Courier New"&gt;HttpModule&lt;/font&gt; which compress the Ajax Web Service response. The following shows the complete code of this module:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.IO;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.IO.Compression;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Globalization;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Web;


&lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;JsonCompressionModule&lt;/span&gt; : &lt;span style="color: rgb(43,145,175)"&gt;IHttpModule
&lt;/span&gt;{
    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; JsonCompressionModule()
    {
    }

    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; Dispose()
    {
    }

    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; Init(&lt;span style="color: rgb(43,145,175)"&gt;HttpApplication&lt;/span&gt; app)
    {
        app.PreRequestHandlerExecute += &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;EventHandler&lt;/span&gt;(Compress);
    }

    &lt;span style="color: rgb(0,0,255)"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; Compress(&lt;span style="color: rgb(0,0,255)"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(43,145,175)"&gt;EventArgs&lt;/span&gt; e)
    {
        &lt;span style="color: rgb(43,145,175)"&gt;HttpApplication&lt;/span&gt; app = (&lt;span style="color: rgb(43,145,175)"&gt;HttpApplication&lt;/span&gt;)sender;
        &lt;span style="color: rgb(43,145,175)"&gt;HttpRequest&lt;/span&gt; request = app.Request;
        &lt;span style="color: rgb(43,145,175)"&gt;HttpResponse&lt;/span&gt; response = app.Response;

        &lt;span style="color: rgb(0,128,0)"&gt;//Ajax Web Service request is always starts with application/json
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (request.ContentType.ToLower(&lt;span style="color: rgb(43,145,175)"&gt;CultureInfo&lt;/span&gt;.InvariantCulture).StartsWith(&lt;span style="color: rgb(163,21,21)"&gt;"application/json"&lt;/span&gt;))
        {
            &lt;span style="color: rgb(0,128,0)"&gt;//User may be using an older version of IE which does not support compression, so skip those
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (!((request.Browser.IsBrowser(&lt;span style="color: rgb(163,21,21)"&gt;"IE"&lt;/span&gt;)) &amp;amp;&amp;amp; (request.Browser.MajorVersion &amp;lt;= 6)))
            {
                &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; acceptEncoding = request.Headers[&lt;span style="color: rgb(163,21,21)"&gt;"Accept-Encoding"&lt;/span&gt;];

                &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (!&lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;.IsNullOrEmpty(acceptEncoding))
                {
                    acceptEncoding = acceptEncoding.ToLower(&lt;span style="color: rgb(43,145,175)"&gt;CultureInfo&lt;/span&gt;.InvariantCulture);

                    &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (acceptEncoding.Contains(&lt;span style="color: rgb(163,21,21)"&gt;"gzip"&lt;/span&gt;))
                    {
                        response.Filter = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;GZipStream&lt;/span&gt;(response.Filter, &lt;span style="color: rgb(43,145,175)"&gt;CompressionMode&lt;/span&gt;.Compress);
                        response.AddHeader(&lt;span style="color: rgb(163,21,21)"&gt;"Content-encoding"&lt;/span&gt;, &lt;span style="color: rgb(163,21,21)"&gt;"gzip"&lt;/span&gt;);
                    }
                    &lt;span style="color: rgb(0,0,255)"&gt;else&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (acceptEncoding.Contains(&lt;span style="color: rgb(163,21,21)"&gt;"deflate"&lt;/span&gt;))
                    {
                        response.Filter = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;DeflateStream&lt;/span&gt;(response.Filter, &lt;span style="color: rgb(43,145,175)"&gt;CompressionMode&lt;/span&gt;.Compress);
                        response.AddHeader(&lt;span style="color: rgb(163,21,21)"&gt;"Content-encoding"&lt;/span&gt;, &lt;span style="color: rgb(163,21,21)"&gt;"deflate"&lt;/span&gt;);
                    }
                }
            }
        }
    }
}&lt;/pre&gt;
&lt;p&gt;Next, register this module in the &lt;font face="Courier New"&gt;web.config&lt;/font&gt; like the following:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;httpModules&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
    &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;add&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;ScriptModule&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
    &lt;strong&gt;&lt;font size="2"&gt;&amp;lt;&lt;/font&gt;&lt;/strong&gt;&lt;/span&gt;&lt;strong&gt;&lt;font size="2"&gt;&lt;span style="color: rgb(163,21,21)"&gt;add&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;name&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;JsonCompressionModule&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;JsonCompressionModule&lt;/span&gt;"&lt;/font&gt;&lt;/strong&gt;&lt;span style="color: rgb(0,0,255)"&gt;&lt;font size="3"&gt;&lt;strong&gt;&lt;font size="2"&gt;/&amp;gt;&lt;/font&gt;
&lt;/strong&gt;&lt;/font&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;httpModules&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;This time the network activity shows like the following:&lt;/p&gt;
&lt;p&gt;&lt;img alt="Compressed Json" src="http://geekswithblogs.net/images/geekswithblogs_net/rashid/7075/r_Compressed.jpg" /&gt;&lt;/p&gt;
&lt;p&gt;So by adding this little module, we have saved 74KB. Now consider the impact of this in an highly traffic ajax web application :-). You will find the complete source code in the bottom of this post. If you want to learn more optimization tips check out my previous post &lt;a href="http://geekswithblogs.net/rashid/archive/2007/07/29/Implement-Yahoos-YSlow-in-your-Asp.net-pages.aspx"&gt;Implement Yahoo's YSlow in your Asp.net pages&lt;/a&gt; and &lt;a href="http://geekswithblogs.net/rashid/archive/2007/07/25/Combine-Multiple-JavaScript-and-CSS-Files-and-Remove-Overheads.aspx"&gt;Combine Multiple JavaScript and CSS Files and Remove Overheads&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download&lt;/strong&gt;: &lt;a href="http://www.box.net/shared/rxqq3muq4b" target="_blank"&gt;Full Source&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/rashid/archive/2007/09/15/Compress-Asp.net-Ajax-Web-Service-Response---Save-Bandwidth.aspx" target="_blank"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/rashid/archive/2007/09/15/Compress-Asp.net-Ajax-Web-Service-Response---Save-Bandwidth.aspx" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115370"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115370" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/rashid/aggbug/115370.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kazi Manzur Rashid</dc:creator>
            <guid>http://geekswithblogs.net/rashid/archive/2007/09/15/Compress-Asp.net-Ajax-Web-Service-Response---Save-Bandwidth.aspx</guid>
            <pubDate>Sat, 15 Sep 2007 11:09:31 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rashid/comments/115370.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rashid/archive/2007/09/15/Compress-Asp.net-Ajax-Web-Service-Response---Save-Bandwidth.aspx#feedback</comments>
            <slash:comments>6</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/rashid/comments/commentRss/115370.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rashid/services/trackbacks/115370.aspx</trackback:ping>
        </item>
        <item>
            <title>Showing Modal Progress Dialog in all Ajax Operation</title>
            <link>http://geekswithblogs.net/rashid/archive/2007/08/24/Showing-Modal-Progress-Dialog-in-all-Ajax-Operation.aspx</link>
            <description>&lt;p&gt;&lt;img alt="Modal Progress Dialog" src="http://geekswithblogs.net/images/geekswithblogs_net/rashid/7024/r_AAO.jpg" /&gt;&lt;/p&gt; &lt;p&gt;If you ever like to show a Modal Progress dialog like the above for any ajax operation no matter which Update Panel or Web Service call is responsible for it, the following code will do the same.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="background: rgb(255,238,98)"&gt;&amp;lt;%&lt;span style="color: rgb(0,0,255)"&gt;&lt;/span&gt;@&lt;/span&gt; &lt;span style="color: rgb(163,21,21)"&gt;Page&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;Language&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="C#"&lt;/span&gt; &lt;span style="background: rgb(255,238,98)"&gt;%&amp;gt;
&lt;span style="color: rgb(0,0,255)"&gt;&lt;/span&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;DOCTYPE&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;html&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;PUBLIC&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;    [System.Web.Services.&lt;span style="color: rgb(43,145,175)"&gt;WebMethod&lt;/span&gt;()]
    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; GetDate()
    {
        &lt;span style="color: rgb(0,128,0)"&gt;//Doing a fake delay for 3 seconds
&lt;/span&gt;        System.Threading.&lt;span style="color: rgb(43,145,175)"&gt;Thread&lt;/span&gt;.Sleep(3000);

        &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;DateTime&lt;/span&gt;.Now.ToString();
    }

    &lt;span style="color: rgb(0,0,255)"&gt;protected&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; Page_Load(&lt;span style="color: rgb(0,0,255)"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(43,145,175)"&gt;EventArgs&lt;/span&gt; e)
    {
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (!IsPostBack)
        {
            lblDate1.Text = lblDate2.Text = &lt;span style="color: rgb(43,145,175)"&gt;DateTime&lt;/span&gt;.Now.ToString();
        }
    }

    &lt;span style="color: rgb(0,0,255)"&gt;protected&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; btnDate1_Click(&lt;span style="color: rgb(0,0,255)"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(43,145,175)"&gt;EventArgs&lt;/span&gt; e)
    {
        &lt;span style="color: rgb(0,128,0)"&gt;//Doing a fake delay for 3 seconds
&lt;/span&gt;        System.Threading.&lt;span style="color: rgb(43,145,175)"&gt;Thread&lt;/span&gt;.Sleep(3000);
        lblDate1.Text = &lt;span style="color: rgb(43,145,175)"&gt;DateTime&lt;/span&gt;.Now.ToString();
    }
&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;html&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;xmlns&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="http://www.w3.org/1999/xhtml"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;head&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;Modal Dialog Progress&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;style&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text/css"&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(163,21,21)"&gt;.modalBackground
&lt;/span&gt;        {
            &lt;span style="color: rgb(255,0,0)"&gt;background-color&lt;/span&gt;:&lt;span style="color: rgb(0,0,255)"&gt;#e6e6e6&lt;/span&gt;;
            &lt;span style="color: rgb(255,0,0)"&gt;filter&lt;/span&gt;:&lt;span style="color: rgb(0,0,255)"&gt;alpha(opacity=60)&lt;/span&gt;;
            &lt;span style="color: rgb(255,0,0)"&gt;opacity&lt;/span&gt;:&lt;span style="color: rgb(0,0,255)"&gt;0.60&lt;/span&gt;;
        }
    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;head&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;form&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="form1"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;ScriptManager&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="ScriptManager1"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;EnablePageMethods&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="true"&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;ScriptManager&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;fieldset&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;legend&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;UpdatePanel&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;legend&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="UpdatePanel1"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="lblDate1"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Button&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="btnDate1"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Get Date"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;OnClick&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="btnDate1_Click"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;fieldset&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;fieldset&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;legend&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;PageMethods&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;legend&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="lblDate2"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Button&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="btnDate2"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Get Date"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;OnClientClick&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="return btnDate2_Click()"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;fieldset&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Panel&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="pnlProgress"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="background-color:#ffffff;display:none;width:400px"&amp;gt;
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="padding:8px"&amp;gt;
&lt;/span&gt;                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;table&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;border&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="0"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;cellpadding&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="2"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;cellspacing&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="0"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="width:100%"&amp;gt;
&lt;/span&gt;                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tbody&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="width:50%"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text-align:right"&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;img&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;alt&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=""&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;src&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="indicator-big.gif"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;                            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text-align:left;white-space:nowrap"&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;span&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="font-size:larger"&amp;gt;&lt;/span&gt;Loading, Please wait ...&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;span&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="width:50%"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tbody&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;table&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Panel&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;ajaxToolKit&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;ModalPopupExtender&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="mpeProgress"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;TargetControlID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="pnlProgress"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;PopupControlID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="pnlProgress"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;BackgroundCssClass&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="modalBackground"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;DropShadow&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="true"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;form&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text/javascript"&amp;gt;

&lt;/span&gt;        Sys.Net.WebRequestManager.add_invokingRequest(onInvoke);
        Sys.Net.WebRequestManager.add_completedRequest(onComplete);

        &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; onInvoke(sender, args)
        {
            $find(&lt;span style="color: rgb(163,21,21)"&gt;'&amp;lt;%= mpeProgress.ClientID %&amp;gt;'&lt;/span&gt;).show();
        }

        &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; onComplete(sender, args)
        {
            $find(&lt;span style="color: rgb(163,21,21)"&gt;'&amp;lt;%= mpeProgress.ClientID %&amp;gt;'&lt;/span&gt;).hide();
        }

        &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; btnDate2_Click()
        {
            PageMethods.GetDate (
                                    &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(result)
                                    {
                                        &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; lbl = $get(&lt;span style="color: rgb(163,21,21)"&gt;'&amp;lt;%= lblDate2.ClientID %&amp;gt;'&lt;/span&gt;);

                                        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (document.all)
                                        {
                                            lbl.innerText = result;
                                        }
                                        &lt;span style="color: rgb(0,0,255)"&gt;else
&lt;/span&gt;                                        {
                                            lbl.textContent = result;
                                        }
                                    }
                                );

            &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt;;
        }

        &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; pageUnload()
        {
            Sys.Net.WebRequestManager.remove_invokingRequest(onInvoke);
            Sys.Net.WebRequestManager.remove_completedRequest(onComplete);
        }

    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;html&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The main trick is hooking the two special events of &lt;font face="Courier New"&gt;Sys.Net.WebRequestManager&lt;/font&gt; class. This class is responsible for managing all kinds of communication with the server, even a manual &lt;font face="Courier New"&gt;invoke&lt;/font&gt; of a &lt;font face="Courier New"&gt;Sys.Net.WebRequest&lt;/font&gt; class will bring this class into action. It fires the &lt;font face="Courier New"&gt;invokingRequest&lt;/font&gt; before making an Ajax call and fires the &lt;font face="Courier New"&gt;completeRequest&lt;/font&gt; once the method completes. We are simply showing/hiding the modal popup extender in these events.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download&lt;/strong&gt;: &lt;a href="http://www.box.net/shared/zvsmp2pftj" target="_blank"&gt;Full Source&lt;a&gt;&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/rashid/archive/2007/08/24/Showing-Modal-Progress-Dialog-in-all-Ajax-Operation.aspx" target="_blank"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/rashid/archive/2007/08/24/Showing-Modal-Progress-Dialog-in-all-Ajax-Operation.aspx" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114951"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114951" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/rashid/aggbug/114951.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kazi Manzur Rashid</dc:creator>
            <guid>http://geekswithblogs.net/rashid/archive/2007/08/24/Showing-Modal-Progress-Dialog-in-all-Ajax-Operation.aspx</guid>
            <pubDate>Sat, 25 Aug 2007 00:13:57 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rashid/comments/114951.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rashid/archive/2007/08/24/Showing-Modal-Progress-Dialog-in-all-Ajax-Operation.aspx#feedback</comments>
            <slash:comments>29</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/rashid/comments/commentRss/114951.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rashid/services/trackbacks/114951.aspx</trackback:ping>
        </item>
        <item>
            <title>Loading UserControl Dynamically in UpdatePanel</title>
            <link>http://geekswithblogs.net/rashid/archive/2007/08/11/Loading-UserControl-Dynamically-in-UpdatePanel.aspx</link>
            <description>&lt;p&gt;In this post, I will show you how to load different user control in UpdatePanel from different menu item click. I have found a lot of request in &lt;a target="_blank" href="http://forums.asp.net/default.aspx?GroupID=34"&gt;Asp.net Ajax Forum&lt;/a&gt; and some of them are having misconception about this. Once you complete reading this post you will be able to load controls dynamically and learn how to employ different helper controls like &lt;font face="Courier New"&gt;UpdateProgress&lt;/font&gt;, &lt;font face="Courier New"&gt;ModalPopupExtender&lt;/font&gt; while the &lt;font face="Courier New"&gt;UserControl&lt;/font&gt; is loading. First let us create plain page without the ajax support:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Markup:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="BACKGROUND: rgb(255,238,98)"&gt;&amp;lt;%&lt;span style="COLOR: rgb(0,0,255)"&gt;&lt;/span&gt;@&lt;/span&gt; &lt;span style="COLOR: rgb(163,21,21)"&gt;Page&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Language&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="C#"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;AutoEventWireup&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="true"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;CodeFile&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="PlainSampleMenu.aspx.cs"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Inherits&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="PlainSampleMenuPage"&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,238,98)"&gt;%&amp;gt;
&lt;span style="COLOR: rgb(0,0,255)"&gt;&lt;/span&gt;&amp;lt;!&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;DOCTYPE&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;html&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;PUBLIC&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;html&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="http://www.w3.org/1999/xhtml"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;head&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;Plain Sample Menu&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;head&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;form&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="form1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Menu&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Menu1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;OnMenuItemClick&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Menu1_MenuItemClick"&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Items&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="File"&amp;gt;
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Load Control1"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Load Control2"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Load Control3"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Items&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Menu&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;br&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;br&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;PlaceHolder&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="PlaceHolder1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;PlaceHolder&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;form&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;html&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;&lt;strong&gt;Code Behind:&lt;/strong&gt;&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;using&lt;/span&gt; System;
&lt;span style="COLOR: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Web;
&lt;span style="COLOR: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Web.UI;
&lt;span style="COLOR: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Web.UI.WebControls;

&lt;span style="COLOR: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;partial&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;class&lt;/span&gt; &lt;span style="COLOR: rgb(43,145,175)"&gt;PlainSampleMenuPage&lt;/span&gt; : System.Web.UI.&lt;span style="COLOR: rgb(43,145,175)"&gt;Page
&lt;/span&gt;{
    &lt;span style="COLOR: rgb(0,0,255)"&gt;private&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;const&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;string&lt;/span&gt; BASE_PATH = &lt;span style="COLOR: rgb(163,21,21)"&gt;"~/DynamicControlLoading/"&lt;/span&gt;;

    &lt;span style="COLOR: rgb(0,0,255)"&gt;private&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;string&lt;/span&gt; LastLoadedControl
    {
        &lt;span style="COLOR: rgb(0,0,255)"&gt;get
&lt;/span&gt;        {
            &lt;span style="COLOR: rgb(0,0,255)"&gt;return&lt;/span&gt; ViewState[&lt;span style="COLOR: rgb(163,21,21)"&gt;"LastLoaded"&lt;/span&gt;] &lt;span style="COLOR: rgb(0,0,255)"&gt;as&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;string&lt;/span&gt;;
        }
        &lt;span style="COLOR: rgb(0,0,255)"&gt;set
&lt;/span&gt;        {
            ViewState[&lt;span style="COLOR: rgb(163,21,21)"&gt;"LastLoaded"&lt;/span&gt;] = &lt;span style="COLOR: rgb(0,0,255)"&gt;value&lt;/span&gt;;
        }
    }

    &lt;span style="COLOR: rgb(0,0,255)"&gt;private&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;void&lt;/span&gt; LoadUserControl()
    {
        &lt;span style="COLOR: rgb(0,0,255)"&gt;string&lt;/span&gt; controlPath = LastLoadedControl;

        &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (!&lt;span style="COLOR: rgb(0,0,255)"&gt;string&lt;/span&gt;.IsNullOrEmpty(controlPath))
        {
            PlaceHolder1.Controls.Clear();
            &lt;span style="COLOR: rgb(43,145,175)"&gt;UserControl&lt;/span&gt; uc = (&lt;span style="COLOR: rgb(43,145,175)"&gt;UserControl&lt;/span&gt;)LoadControl(controlPath);
            PlaceHolder1.Controls.Add(uc);
        }
    }

    &lt;span style="COLOR: rgb(0,0,255)"&gt;protected&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;void&lt;/span&gt; Page_Load(&lt;span style="COLOR: rgb(0,0,255)"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: rgb(43,145,175)"&gt;EventArgs&lt;/span&gt; e)
    {
        LoadUserControl();
    }

    &lt;span style="COLOR: rgb(0,0,255)"&gt;protected&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;void&lt;/span&gt; Menu1_MenuItemClick(&lt;span style="COLOR: rgb(0,0,255)"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: rgb(43,145,175)"&gt;MenuEventArgs&lt;/span&gt; e)
    {
        &lt;span style="COLOR: rgb(43,145,175)"&gt;MenuItem&lt;/span&gt; menu = e.Item;

        &lt;span style="COLOR: rgb(0,0,255)"&gt;string&lt;/span&gt; controlPath = &lt;span style="COLOR: rgb(0,0,255)"&gt;string&lt;/span&gt;.Empty;

        &lt;span style="COLOR: rgb(0,0,255)"&gt;switch&lt;/span&gt; (menu.Text)
        {
            &lt;span style="COLOR: rgb(0,0,255)"&gt;case&lt;/span&gt; &lt;span style="COLOR: rgb(163,21,21)"&gt;"Load Control2"&lt;/span&gt;:
                controlPath = BASE_PATH + &lt;span style="COLOR: rgb(163,21,21)"&gt;"SampleControl2.ascx"&lt;/span&gt;;
                &lt;span style="COLOR: rgb(0,0,255)"&gt;break&lt;/span&gt;;
            &lt;span style="COLOR: rgb(0,0,255)"&gt;case&lt;/span&gt; &lt;span style="COLOR: rgb(163,21,21)"&gt;"Load Control3"&lt;/span&gt;:
                controlPath = BASE_PATH + &lt;span style="COLOR: rgb(163,21,21)"&gt;"SampleControl3.ascx"&lt;/span&gt;;
                &lt;span style="COLOR: rgb(0,0,255)"&gt;break&lt;/span&gt;;
            &lt;span style="COLOR: rgb(0,0,255)"&gt;default&lt;/span&gt;:
                controlPath = BASE_PATH + &lt;span style="COLOR: rgb(163,21,21)"&gt;"SampleControl1.ascx"&lt;/span&gt;;
                &lt;span style="COLOR: rgb(0,0,255)"&gt;break&lt;/span&gt;;
        }

        LastLoadedControl = controlPath;
        LoadUserControl();
    }
}
&lt;/pre&gt;
&lt;p&gt;As you can see we are loading the UserControls in the PlaceHolder Control on different menu item click. If you are wondering why I am also loading the controls in &lt;font face="Courier New"&gt;Page&lt;/font&gt; &lt;font face="Courier New"&gt;Load&lt;/font&gt; event based upon the &lt;font face="Courier New"&gt;ViewState&lt;/font&gt;, the reason is otherwise those dynamically loaded controls will not be visible in the consequent postbacks. There are few good articles written by &lt;a target="_blank" href="http://www.scottonwriting.net/sowBlog/"&gt;Scott Mitchell&lt;/a&gt; on dynamically loading Controls which you will find in the following links:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://aspnet.4guysfromrolla.com/articles/081402-1.aspx"&gt;Dynamic Controls in ASP.NET&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://aspnet.4guysfromrolla.com/articles/082102-1.aspx"&gt;Working with Dynamically Created Controls&lt;/a&gt; &lt;/li&gt;
    &lt;li&gt;&lt;a target="_blank" href="http://aspnet.4guysfromrolla.com/articles/092904-1.aspx"&gt;Dynamic Web Controls, Postbacks, and View State&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Now let us ajaxify this page, lets wrap the &lt;font face="Courier New"&gt;PlaceHolder&lt;/font&gt; with an &lt;font face="Courier New"&gt;UpdatePanel&lt;/font&gt; control. The following shows the markup:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="BACKGROUND: rgb(255,238,98)"&gt;&amp;lt;%&lt;span style="COLOR: rgb(0,0,255)"&gt;&lt;/span&gt;@&lt;/span&gt; &lt;span style="COLOR: rgb(163,21,21)"&gt;Page&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Language&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="C#"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;AutoEventWireup&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="true"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;CodeFile&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="SampleMenu1.aspx.cs"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Inherits&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="SampleMenuPage1"&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,238,98)"&gt;%&amp;gt;
&lt;span style="COLOR: rgb(0,0,255)"&gt;&lt;/span&gt;&amp;lt;!&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;DOCTYPE&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;html&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;PUBLIC&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;html&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="http://www.w3.org/1999/xhtml"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;head&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;Sample Menu&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;head&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;form&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="form1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Menu&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Menu1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;OnMenuItemClick&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Menu1_MenuItemClick"&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Items&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="File"&amp;gt;
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Load Control1"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Load Control2"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Load Control3"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Items&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Menu&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;br&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;br&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ScriptManager&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="ScriptManager1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ScriptManager&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="UpdatePanel1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;UpdateMode&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Conditional"&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;PlaceHolder&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="PlaceHolder1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;PlaceHolder&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Triggers&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;AsyncPostBackTrigger&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ControlID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Menu1"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Triggers&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;form&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;html&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Since the &lt;font face="Courier New"&gt;Menu&lt;/font&gt; control resides outside the &lt;font face="Courier New"&gt;UpdatePanel&lt;/font&gt; we will also need a &lt;font face="Courier New"&gt;AsyncPostBackTrigger&lt;/font&gt; for the &lt;font face="Courier New"&gt;Menu&lt;/font&gt; Control. Now run this page, you will find the controls are loaded without a full postback.&lt;/p&gt;
&lt;p&gt;Now let us further enhance this page with &lt;font face="Courier New"&gt;UpdateProgress&lt;/font&gt; and AjaxControlToolKit's &lt;font face="Courier New"&gt;ModalPopupExtender&lt;/font&gt;. First with the &lt;font face="Courier New"&gt;UpdateProgress&lt;/font&gt; Control.&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="BACKGROUND: rgb(255,238,98)"&gt;&amp;lt;%&lt;span style="COLOR: rgb(0,0,255)"&gt;&lt;/span&gt;@&lt;/span&gt; &lt;span style="COLOR: rgb(163,21,21)"&gt;Page&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Language&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="C#"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;AutoEventWireup&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="true"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;CodeFile&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="SampleMenu1.aspx.cs"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Inherits&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="SampleMenuPage1"&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,238,98)"&gt;%&amp;gt;
&lt;span style="COLOR: rgb(0,0,255)"&gt;&lt;/span&gt;&amp;lt;!&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;DOCTYPE&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;html&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;PUBLIC&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;html&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="http://www.w3.org/1999/xhtml"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;head&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;Sample Menu - UpdateProgress&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;head&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;form&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="form1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Menu&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Menu1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;OnMenuItemClick&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Menu1_MenuItemClick"&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Items&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="File"&amp;gt;
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Load Control1"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Load Control2"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Load Control3"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Items&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Menu&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;br&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;br&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ScriptManager&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="ScriptManager1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ScriptManager&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="UpdatePanel1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;UpdateMode&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Conditional"&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdateProgress&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="UpdateProgress1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;AssociatedUpdatePanelID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="UpdatePanel1"&amp;gt;
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ProgressTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        Loading....
                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ProgressTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdateProgress&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;PlaceHolder&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="PlaceHolder1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;PlaceHolder&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Triggers&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;AsyncPostBackTrigger&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ControlID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Menu1"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Triggers&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;form&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;html&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As you can see we have added a &lt;font face="Courier New"&gt;UpdateProgress&lt;/font&gt; Control in the &lt;font face="Courier New"&gt;UpdatePanel&lt;/font&gt; &lt;font face="Courier New"&gt;ContentTemplate&lt;/font&gt;. But the &lt;font face="Courier New"&gt;UpdateProgress&lt;/font&gt; does not get visible when you click any of the menu item. This is the true nature of &lt;font face="Courier New"&gt;UpdatePanel&lt;/font&gt;, it does not shows the &lt;font face="Courier New"&gt;UpdateProgress&lt;/font&gt; if the control is out side the &lt;font face="Courier New"&gt;UpdatePanel&lt;/font&gt; which caused the postback. We have to manually show the &lt;font face="Courier New"&gt;UpdateProgress&lt;/font&gt; by the JavaScript code like the following:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;script&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="text/javascript"&amp;gt;

&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; prm = Sys.WebForms.PageRequestManager.getInstance();

    prm.add_initializeRequest(initializeRequest);
    prm.add_endRequest(endRequest);

    &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; _postBackElement;

    &lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt; initializeRequest(sender, e)
    {
        &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (prm.get_isInAsyncPostBack())
        {
            e.set_cancel(&lt;span style="COLOR: rgb(0,0,255)"&gt;true&lt;/span&gt;);
        }

        _postBackElement = e.get_postBackElement();

        &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (_postBackElement.id.indexOf(&lt;span style="COLOR: rgb(163,21,21)"&gt;'Menu1'&lt;/span&gt;) &amp;gt; -1)
        {
            $get(&lt;span style="COLOR: rgb(163,21,21)"&gt;'UpdateProgress1'&lt;/span&gt;).style.display = &lt;span style="COLOR: rgb(163,21,21)"&gt;'block'&lt;/span&gt;;
        }
    }

    &lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt; endRequest(sender, e)
    {
        &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (_postBackElement.id.indexOf(&lt;span style="COLOR: rgb(163,21,21)"&gt;'Menu1'&lt;/span&gt;) &amp;gt; -1)
        {
            $get(&lt;span style="COLOR: rgb(163,21,21)"&gt;'UpdateProgress1'&lt;/span&gt;).style.display = &lt;span style="COLOR: rgb(163,21,21)"&gt;'none'&lt;/span&gt;;
        }
    }
&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;script&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;Now run the page, you will find the &lt;font face="Courier New"&gt;UpdateProgress&lt;/font&gt; Control is showing the loading message no matter which control caused the postback.&lt;/p&gt;
&lt;p&gt;In this final section we will implement the AjaxControlToolKit's &lt;font face="Courier New"&gt;ModalPopupExtender&lt;/font&gt; to show the loading message, this will give you a similar look of CodePlex Site. The following shows the source:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="BACKGROUND: rgb(255,238,98)"&gt;&amp;lt;%&lt;span style="COLOR: rgb(0,0,255)"&gt;&lt;/span&gt;@&lt;/span&gt; &lt;span style="COLOR: rgb(163,21,21)"&gt;Page&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Language&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="C#"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;AutoEventWireup&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="true"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;CodeFile&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="SampleMenu2.aspx.cs"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Inherits&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="SampleMenuPage2"&lt;/span&gt; &lt;span style="BACKGROUND: rgb(255,238,98)"&gt;%&amp;gt;
&lt;span style="COLOR: rgb(0,0,255)"&gt;&lt;/span&gt;&amp;lt;!&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;DOCTYPE&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;html&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;PUBLIC&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;html&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="http://www.w3.org/1999/xhtml"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;head&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;Sample Menu - ModalPopupExtender&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;style&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="text/css"&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(163,21,21)"&gt;.modalBackground
&lt;/span&gt;        {
            &lt;span style="COLOR: rgb(255,0,0)"&gt;background-color&lt;/span&gt;:&lt;span style="COLOR: rgb(0,0,255)"&gt;#dcdcdc&lt;/span&gt;;
            &lt;span style="COLOR: rgb(255,0,0)"&gt;filter&lt;/span&gt;:&lt;span style="COLOR: rgb(0,0,255)"&gt;alpha(opacity=60)&lt;/span&gt;;
            &lt;span style="COLOR: rgb(255,0,0)"&gt;opacity&lt;/span&gt;:&lt;span style="COLOR: rgb(0,0,255)"&gt;0.60&lt;/span&gt;;
        }
    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;style&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;head&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;form&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="form1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Menu&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Menu1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;OnMenuItemClick&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Menu1_MenuItemClick"&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Items&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="File"&amp;gt;
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Load Control1"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Load Control2"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Load Control3"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;MenuItem&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Items&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Menu&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;br&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;br&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ScriptManager&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="ScriptManager1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ScriptManager&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="UpdatePanel1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;UpdateMode&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Conditional"&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;PlaceHolder&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="PlaceHolder1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;PlaceHolder&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Triggers&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;AsyncPostBackTrigger&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ControlID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Menu1"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Triggers&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Panel&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Panel1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="background-color:#ffffff;display:none;width:400px"&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;div&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="padding:8px"&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;h2&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;Loading...&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;h2&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Panel&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ajaxToolKit&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ModalPopupExtender&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="ModalPopupExtender1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;TargetControlID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Panel1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;PopupControlID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Panel1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;BackgroundCssClass&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="modalBackground"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;DropShadow&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="true"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;script&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="text/javascript"&amp;gt;

&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; prm = Sys.WebForms.PageRequestManager.getInstance();

            prm.add_initializeRequest(initializeRequest);
            prm.add_endRequest(endRequest);

            &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; _postBackElement;

            &lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt; initializeRequest(sender, e)
            {
                &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (prm.get_isInAsyncPostBack())
                {
                    e.set_cancel(&lt;span style="COLOR: rgb(0,0,255)"&gt;true&lt;/span&gt;);
                }

                _postBackElement = e.get_postBackElement();

                &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (_postBackElement.id.indexOf(&lt;span style="COLOR: rgb(163,21,21)"&gt;'Menu1'&lt;/span&gt;) &amp;gt; -1)
                {
                    $find(&lt;span style="COLOR: rgb(163,21,21)"&gt;'ModalPopupExtender1'&lt;/span&gt;).show();
                }
            }

            &lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt; endRequest(sender, e)
            {
                &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (_postBackElement.id.indexOf(&lt;span style="COLOR: rgb(163,21,21)"&gt;'Menu1'&lt;/span&gt;) &amp;gt; -1)
                {
                    $find(&lt;span style="COLOR: rgb(163,21,21)"&gt;'ModalPopupExtender1'&lt;/span&gt;).hide();
                }
            }
        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;script&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;form&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;html&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As you can see we first created a custom style which will be shown as the background style when the modal popup is visible, next we have added a regular Asp.net &lt;font face="Courier New"&gt;Panel&lt;/font&gt; control which will be shown as the modal popup. We have initially set the Panel control display mode to none, so there will be no flicker when the modal popup is shown. At last, we have added a &lt;font face="Courier New"&gt;ModalPopupExtender&lt;/font&gt; and sets its required property. The previous rule also applies here, we have to manually show/hide the ModalPopup which we are doing in the above JavaScript code. You will also found few cool techniques of ModalPopupExtender in this &lt;a target="_blank" href="http://mattberseth.com/blog/modalpopupextender/"&gt;link&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;To run the sample first create a AjaxControlToolKit enable site website then create a folder DynamicControlLoading folder and copy the files in the following attachment.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download&lt;/strong&gt;: &lt;a target="_blank" href="http://www.box.net/shared/2bto1jb0u3"&gt;Complete Source&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/rashid/archive/2007/08/11/Loading-UserControl-Dynamically-in-UpdatePanel.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/rashid/archive/2007/08/11/Loading-UserControl-Dynamically-in-UpdatePanel.aspx" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114574"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114574" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/rashid/aggbug/114574.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kazi Manzur Rashid</dc:creator>
            <guid>http://geekswithblogs.net/rashid/archive/2007/08/11/Loading-UserControl-Dynamically-in-UpdatePanel.aspx</guid>
            <pubDate>Sun, 12 Aug 2007 01:48:32 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rashid/comments/114574.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rashid/archive/2007/08/11/Loading-UserControl-Dynamically-in-UpdatePanel.aspx#feedback</comments>
            <slash:comments>19</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/rashid/comments/commentRss/114574.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rashid/services/trackbacks/114574.aspx</trackback:ping>
        </item>
        <item>
            <title>Asp.net Ajax UpdatePanel Simultaneous Update - A Remedy</title>
            <link>http://geekswithblogs.net/rashid/archive/2007/08/08/Asp.net-Ajax-UpdatePanel-Simultaneous-Update---A-Remedy.aspx</link>
            <description>&lt;p&gt;If you ever try to do more than one simultaneous partial update with Asp.net Ajax Update Panel, I guess  you already found  that Asp.net Ajax Framework cancel the current update request and starts the new one. You think I am kidding? Okay lets try the following code:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="BACKGROUND: rgb(255,238,98)"&gt;&amp;lt;%&lt;span style="COLOR: rgb(0,0,255)"&gt;&lt;/span&gt;@&lt;/span&gt; &lt;span style="COLOR: rgb(163,21,21)"&gt;Page&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Language&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="C#"&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,238,98)"&gt;%&amp;gt;
&lt;span style="COLOR: rgb(0,0,255)"&gt;&lt;/span&gt;&amp;lt;!&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;DOCTYPE&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;html&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;PUBLIC&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;script&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;protected&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;void&lt;/span&gt; Page_Load(&lt;span style="COLOR: rgb(0,0,255)"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: rgb(43,145,175)"&gt;EventArgs&lt;/span&gt; e)
    {
        &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (!IsPostBack)
        {
            lblDate1.Text = lblDate2.Text = &lt;span style="COLOR: rgb(43,145,175)"&gt;DateTime&lt;/span&gt;.Now.ToString();
        }
    }

    &lt;span style="COLOR: rgb(0,0,255)"&gt;protected&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;void&lt;/span&gt; btnDate1_Click(&lt;span style="COLOR: rgb(0,0,255)"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: rgb(43,145,175)"&gt;EventArgs&lt;/span&gt; e)
    {
        System.Threading.&lt;span style="COLOR: rgb(43,145,175)"&gt;Thread&lt;/span&gt;.Sleep(1000 * 5); &lt;span style="COLOR: rgb(0,128,0)"&gt;// Sleeps 5 second
&lt;/span&gt;        lblDate1.Text = &lt;span style="COLOR: rgb(43,145,175)"&gt;DateTime&lt;/span&gt;.Now.ToString();
    }

    &lt;span style="COLOR: rgb(0,0,255)"&gt;protected&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;void&lt;/span&gt; btnDate2_Click(&lt;span style="COLOR: rgb(0,0,255)"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: rgb(43,145,175)"&gt;EventArgs&lt;/span&gt; e)
    {
        System.Threading.&lt;span style="COLOR: rgb(43,145,175)"&gt;Thread&lt;/span&gt;.Sleep(1000 * 5); &lt;span style="COLOR: rgb(0,128,0)"&gt;// Sleeps 5 second
&lt;/span&gt;        lblDate2.Text = &lt;span style="COLOR: rgb(43,145,175)"&gt;DateTime&lt;/span&gt;.Now.ToString();
    }
&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;script&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;html&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="http://www.w3.org/1999/xhtml"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;head&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;Update Panel&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;head&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;form&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="form1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ScriptManager&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="ScriptManager1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ScriptManager&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="updDate1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;UpdateMode&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Conditional"&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                Update Panel 1: &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Label&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="lblDate1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Label&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Button&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="btnDate1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Update Time"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;OnClick&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="btnDate1_Click"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="updDate2"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;UpdateMode&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Conditional"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;RenderMode&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Inline"&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    Update Panel 2: &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Label&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="lblDate2"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Label&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Button&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="btnDate2"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Update Time"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;OnClick&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="btnDate2_Click"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;form&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;html&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The example is quite simple, I have two update panel which &lt;font face="Courier New"&gt;UpdateMode&lt;/font&gt; is set to &lt;font face="Courier New"&gt;Conditional&lt;/font&gt;, upon clicking the buttons inside the update panel I am doing a fake delay of 5 seconds then printing the current time of the server in the labels. Okay now run the code and click the first button and then click the second button in 5 seconds so that you can do simultaneous update. What happens, the first label never gets updated? Yes this is the nature of update panel, it cancels the current call and start executing the new one. You can get a more clear picture if you run it in &lt;a target="_blank" href="http://www.mozilla.com/en-US/firefox/"&gt;FireFox&lt;/a&gt; with &lt;a target="_blank" href="http://www.getfirebug.com/"&gt;FireBug&lt;/a&gt;, Open FireFox Click Tools-&amp;gt;FireBug-&amp;gt;Open FireBug, then move to the Console tab in the firebug and repeat the button clicks, you will find only the last request spinning  animation gets completed.&lt;/p&gt;
&lt;p&gt;I can understand the Update Panel does a monsters job for us, executing the full life cycle of the page in the server, generating the updated part of the page, downloading new scripts, updating viewstates etc and that is why it needs to work serially. But how come it discards it current update request once it found a new request? is not it better if it queues the new request and execute it once the current request completes? &lt;br /&gt;
&lt;br /&gt;
Now Consider the following page:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="BACKGROUND: rgb(255,238,98)"&gt;&amp;lt;%&lt;span style="COLOR: rgb(0,0,255)"&gt;&lt;/span&gt;@&lt;/span&gt; &lt;span style="COLOR: rgb(163,21,21)"&gt;Page&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Language&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="C#"&lt;/span&gt;&lt;span style="BACKGROUND: rgb(255,238,98)"&gt;%&amp;gt;
&lt;span style="COLOR: rgb(0,0,255)"&gt;&lt;/span&gt;&amp;lt;!&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;DOCTYPE&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;html&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;PUBLIC&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;script&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;protected&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;void&lt;/span&gt; Page_Load(&lt;span style="COLOR: rgb(0,0,255)"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: rgb(43,145,175)"&gt;EventArgs&lt;/span&gt; e)
    {
        &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (!IsPostBack)
        {
            lblDate1.Text = lblDate2.Text = &lt;span style="COLOR: rgb(43,145,175)"&gt;DateTime&lt;/span&gt;.Now.ToString();
        }
    }

    &lt;span style="COLOR: rgb(0,0,255)"&gt;protected&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;void&lt;/span&gt; btnDate1_Click(&lt;span style="COLOR: rgb(0,0,255)"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: rgb(43,145,175)"&gt;EventArgs&lt;/span&gt; e)
    {
        System.Threading.&lt;span style="COLOR: rgb(43,145,175)"&gt;Thread&lt;/span&gt;.Sleep(1000 * 5); &lt;span style="COLOR: rgb(0,128,0)"&gt;// Sleeps 5 second
&lt;/span&gt;        lblDate1.Text = &lt;span style="COLOR: rgb(43,145,175)"&gt;DateTime&lt;/span&gt;.Now.ToString();
    }

    &lt;span style="COLOR: rgb(0,0,255)"&gt;protected&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;void&lt;/span&gt; btnDate2_Click(&lt;span style="COLOR: rgb(0,0,255)"&gt;object&lt;/span&gt; sender, &lt;span style="COLOR: rgb(43,145,175)"&gt;EventArgs&lt;/span&gt; e)
    {
        System.Threading.&lt;span style="COLOR: rgb(43,145,175)"&gt;Thread&lt;/span&gt;.Sleep(1000 * 5); &lt;span style="COLOR: rgb(0,128,0)"&gt;// Sleeps 5 second
&lt;/span&gt;        lblDate2.Text = &lt;span style="COLOR: rgb(43,145,175)"&gt;DateTime&lt;/span&gt;.Now.ToString();
    }
&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;script&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;html&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;xmlns&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="http://www.w3.org/1999/xhtml"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;head&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;Update Panel Enhanced&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;head&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;form&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="form1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ScriptManager&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="ScriptManager1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Scripts&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ScriptReference&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Path&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="~/Test/PageRequestManagerEx.js"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Scripts&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ScriptManager&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;script&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="text/javascript"&amp;gt;
&lt;/span&gt;            PageRequestManagerEx.init();
        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;script&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="updDate1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;UpdateMode&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Conditional"&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                Update Panel 1: &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Label&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="lblDate1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Label&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Button&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="btnDate1"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Update Time"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;OnClick&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="btnDate1_Click"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="updDate2"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;UpdateMode&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Conditional"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;RenderMode&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Inline"&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    Update Panel 2: &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Label&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="lblDate2"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Label&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;Button&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="btnDate2"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="Update Time"&lt;/span&gt; &lt;span style="COLOR: rgb(255,0,0)"&gt;OnClick&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;="btnDate2_Click"&lt;/span&gt; &lt;span style="COLOR: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;UpdatePanel&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;form&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="COLOR: rgb(163,21,21)"&gt;html&lt;/span&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The only difference you will find from the previous one that I have added a new JavaScript file &lt;font face="Courier New"&gt;PageRequestManagerEx.js&lt;/font&gt; and called a method &lt;font face="Courier New"&gt;PageRequestManagerEx.init()&lt;/font&gt;. Now run this page and repeat the button clicks, you will find the complete source in the bottom of this post. If you run it in FireFox with FireBug, you will find that no matter how many clicks you made in those buttons there is only one concurrent call and once the current call completes it executes another call. Yes as you have guessed the new JavaScript file which I just added does the trick. Now let us see what is in the JavaScript file.&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; PageRequestManagerEx =
{
    _initialized : &lt;span style="COLOR: rgb(0,0,255)"&gt;false&lt;/span&gt;,

    init : &lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt;()
    {
        &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (!PageRequestManagerEx._initialized)
        {
            &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; _callQueue = &lt;span style="COLOR: rgb(0,0,255)"&gt;new&lt;/span&gt; Array();
            &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; _executingElement = &lt;span style="COLOR: rgb(0,0,255)"&gt;null&lt;/span&gt;;
            &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; prm = Sys.WebForms.PageRequestManager.getInstance();

            _prm.add_initializeRequest(initializeRequest);
            _prm.add_endRequest(endRequest);

            PageRequestManagerEx._initialized = &lt;span style="COLOR: rgb(0,0,255)"&gt;true&lt;/span&gt;;
        }

        &lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt; initializeRequest(sender, args)
        {
            &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (_prm.get_isInAsyncPostBack())
            {
                &lt;span style="COLOR: rgb(0,128,0)"&gt;//if we are here that means there already a call pending.

&lt;/span&gt;                &lt;span style="COLOR: rgb(0,128,0)"&gt;//Get the element which cause the postback
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; postBackElement = args.get_postBackElement();

                &lt;span style="COLOR: rgb(0,128,0)"&gt;//We need to check this otherwise it will abort the request which we made from the
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,128,0)"&gt;//end request
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (_executingElement != postBackElement)
                {
                    &lt;span style="COLOR: rgb(0,128,0)"&gt;//Does not match which means it is another control
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,128,0)"&gt;//which request the update, so cancel it temporary and 
&lt;/span&gt;                    &lt;span style="COLOR: rgb(0,128,0)"&gt;//add it in the call queue
&lt;/span&gt;                    args.set_cancel(&lt;span style="COLOR: rgb(0,0,255)"&gt;true&lt;/span&gt;);
                    Array.enqueue(_callQueue, postBackElement);
                }

                &lt;span style="COLOR: rgb(0,128,0)"&gt;//Reset it as we are done with our matching
&lt;/span&gt;                _executingElement = &lt;span style="COLOR: rgb(0,0,255)"&gt;null&lt;/span&gt;;
            }
        }

        &lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt; endRequest(sender, args)
        {
            &lt;span style="COLOR: rgb(0,128,0)"&gt;//Check if we have a pending call
&lt;/span&gt;            &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (_callQueue.length &amp;gt; 0)
            {
                &lt;span style="COLOR: rgb(0,128,0)"&gt;//Get the first item from the call queue and setting it
&lt;/span&gt;                &lt;span style="COLOR: rgb(0,128,0)"&gt;//as current executing item
&lt;/span&gt;                _executingElement = Array.dequeue(_callQueue);

                &lt;span style="COLOR: rgb(0,128,0)"&gt;//Now Post the from which will also fire the initializeRequest
&lt;/span&gt;                _prm._doPostBack(_executingElement.id, &lt;span style="COLOR: rgb(163,21,21)"&gt;''&lt;/span&gt;);
            }
        }
    }
}

&lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (&lt;span style="COLOR: rgb(0,0,255)"&gt;typeof&lt;/span&gt;(Sys) != &lt;span style="COLOR: rgb(163,21,21)"&gt;'undefined'&lt;/span&gt;)
{
    Sys.Application.notifyScriptLoaded();
}
&lt;/pre&gt;
&lt;p&gt;The &lt;font face="Courier New"&gt;PageRequestManagerEx&lt;/font&gt; is a Static class which hooks the &lt;font face="Courier New"&gt;initializeRequest&lt;/font&gt; and &lt;font face="Courier New"&gt;endRequest&lt;/font&gt; events of the original &lt;font face="Courier New"&gt;PageRequestManager&lt;/font&gt;. Then in the &lt;font face="Courier New"&gt;initializeRequest&lt;/font&gt; it first checks if there is an ongoing update, if so it cancel the new request and adds the control in a queue which cause the postback. Then in the &lt;font face="Courier New"&gt;endRequest&lt;/font&gt; it check if there is any pending call in the queue, if so it executes it. This loops gets executed until all the call in the queue get completed.&lt;/p&gt;
&lt;p&gt;Lets me know if you found any issue. I will  be also very curious to know why update panel does not behave like this?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download&lt;/strong&gt; : &lt;a target="_blank" href="http://www.box.net/shared/ydcb954xrz"&gt;Complete Source&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/rashid/archive/2007/08/08/Asp.net-Ajax-UpdatePanel-Simultaneous-Update---A-Remedy.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" border="0" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/rashid/archive/2007/08/08/Asp.net-Ajax-UpdatePanel-Simultaneous-Update---A-Remedy.aspx" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114475"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114475" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/rashid/aggbug/114475.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kazi Manzur Rashid</dc:creator>
            <guid>http://geekswithblogs.net/rashid/archive/2007/08/08/Asp.net-Ajax-UpdatePanel-Simultaneous-Update---A-Remedy.aspx</guid>
            <pubDate>Wed, 08 Aug 2007 11:29:07 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rashid/comments/114475.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rashid/archive/2007/08/08/Asp.net-Ajax-UpdatePanel-Simultaneous-Update---A-Remedy.aspx#feedback</comments>
            <slash:comments>20</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/rashid/comments/commentRss/114475.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rashid/services/trackbacks/114475.aspx</trackback:ping>
        </item>
        <item>
            <title>Create An Ajax Style File Upload</title>
            <link>http://geekswithblogs.net/rashid/archive/2007/08/01/Create-An-Ajax-Style-File-Upload.aspx</link>
            <description>&lt;p&gt;If you visit &lt;a href="http://forums.asp.net/default.aspx?GroupID=34" target="_blank"&gt;Asp.net Ajax Forum&lt;/a&gt;, you will find hundreds of request on File Upload Control that it does not give Ajax version of the page when it is placed in an &lt;font face="Courier New"&gt;UpdatePanel&lt;/font&gt;. Certainly, it is not possible, as the &lt;font face="Courier New"&gt;XMLHTTPRequest&lt;/font&gt; object that is used internally to post the form does not support file upload. In this post I will show you how to create Ajax like version of the file upload. The trick is very simple, I will use an &lt;font face="Courier New"&gt;Iframe&lt;/font&gt; to upload the file so the whole page does not get refreshed and when the post is in progress it will show a dummy progress. The following shows you the screenshots of the solutions:&lt;/p&gt; &lt;p&gt; &lt;/p&gt;&lt;table cellspacing="0" cellpadding="3" border="0" unselectable="on"&gt; &lt;tbody&gt; &lt;tr&gt; &lt;td style="vertical-align: top"&gt;&lt;img alt="Initial" src="http://geekswithblogs.net/images/geekswithblogs_net/rashid/6912/r_Initial.jpg" /&gt;&lt;/td&gt; &lt;td style="vertical-align: top"&gt;&lt;img alt="In Progress" src="http://geekswithblogs.net/images/geekswithblogs_net/rashid/6912/r_InProgress.jpg" /&gt;&lt;/td&gt; &lt;td style="vertical-align: top"&gt;&lt;img alt="Complete" src="http://geekswithblogs.net/images/geekswithblogs_net/rashid/6912/r_Complete.jpg" /&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt; &lt;p&gt;Now lets discuss the implementation part, starting with the Main page markup.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;fieldset&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;legend&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;Photo Upload Demo&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;legend&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="divFrame"&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;iframe&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="ifrPhoto"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;onload&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="initPhotoUpload()"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;scrolling&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="no"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;frameborder&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="0"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;hidefocus&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="true"&lt;/span&gt; &lt;br /&gt;&lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text-align:center;vertical-align:middle;border-style:none;margin:0px;width:100%;height:55px"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;src&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="PhotoUpload.aspx"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;iframe&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="divUploadMessage"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="padding-top:4px;display:none"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="divUploadProgress"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="padding-top:4px;display:none"&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;span&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="font-size:smaller"&amp;gt;&lt;/span&gt;Uploading photo...&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;span&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;table&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;border&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="0"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;cellpadding&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="0"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;cellspacing&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="2"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="width:100%"&amp;gt;
&lt;/span&gt;                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tbody&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="tdProgress1"&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="tdProgress2"&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="tdProgress3"&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="tdProgress4"&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="tdProgress5"&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="tdProgress6"&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="tdProgress7"&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="tdProgress8"&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="tdProgress9"&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="tdProgress10"&amp;gt;&lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;&amp;amp;nbsp;&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tbody&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;table&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;fieldset&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As you see that we are using few &lt;font face="Courier New"&gt;divs&lt;/font&gt; to show and hide the upload form and the progress bar. The important thing is we are binding the &lt;font face="Courier New"&gt;initPhotoUpload&lt;/font&gt; in the frame &lt;font face="Courier New"&gt;load&lt;/font&gt; event. Now let us check the &lt;font face="Courier New"&gt;iframe&lt;/font&gt; source page markup.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;form&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="photoUpload"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;enctype&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="multipart/form-data"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;input&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="filPhoto"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="file"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"/&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="divUpload"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="padding-top:4px"&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;input&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="btnUpload"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="button"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Upload Photo"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;form&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The &lt;font face="Courier New"&gt;iframe&lt;/font&gt; source page contains only a file upload control and a button to post the form. Now lets get back to the main page &lt;font face="Courier New"&gt;initPhotoUpload&lt;/font&gt; function and lets check how it is implemented:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; initPhotoUpload()
{
    _divFrame = document.getElementById(&lt;span style="color: rgb(163,21,21)"&gt;'divFrame'&lt;/span&gt;);
    _divUploadMessage = document.getElementById(&lt;span style="color: rgb(163,21,21)"&gt;'divUploadMessage'&lt;/span&gt;);
    _divUploadProgress = document.getElementById(&lt;span style="color: rgb(163,21,21)"&gt;'divUploadProgress'&lt;/span&gt;);
    _ifrPhoto = document.getElementById(&lt;span style="color: rgb(163,21,21)"&gt;'ifrPhoto'&lt;/span&gt;);

    &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; btnUpload = _ifrPhoto.contentWindow.document.getElementById(&lt;span style="color: rgb(163,21,21)"&gt;'btnUpload'&lt;/span&gt;);

    btnUpload.onclick = &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(&lt;span style="color: rgb(0,0,255)"&gt;event&lt;/span&gt;)
    {
        &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; filPhoto = _ifrPhoto.contentWindow.document.getElementById(&lt;span style="color: rgb(163,21,21)"&gt;'filPhoto'&lt;/span&gt;);

        &lt;span style="color: rgb(0,128,0)"&gt;//Baisic validation for Photo
&lt;/span&gt;        _divUploadMessage.style.display = &lt;span style="color: rgb(163,21,21)"&gt;'none'&lt;/span&gt;;

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (filPhoto.value.length == 0)
        {
            _divUploadMessage.innerHTML = &lt;span style="color: rgb(163,21,21)"&gt;'&amp;lt;span style=\"color:#ff0000\"&amp;gt;Please specify the file.&amp;lt;/span&amp;gt;'&lt;/span&gt;;
            _divUploadMessage.style.display = &lt;span style="color: rgb(163,21,21)"&gt;''&lt;/span&gt;;
            filPhoto.focus();
            &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt;;
        }

        &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; regExp = /^(([a-zA-Z]:)|(\\{2}\w+)\$?)(\\(\w[\w].*))(.jpg|.JPG|.gif|.GIF|.png|.PNG|.bmp|.BMP)$/;

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (!regExp.test(filPhoto.value)) &lt;span style="color: rgb(0,128,0)"&gt;//Somehow the expression does not work in Opera
&lt;/span&gt;        {
            _divUploadMessage.innerHTML = &lt;span style="color: rgb(163,21,21)"&gt;'&amp;lt;span style=\"color:#ff0000\"&amp;gt;Invalid file type. Only supports jpg, gif, png and bmp.&amp;lt;/span&amp;gt;'&lt;/span&gt;;
            _divUploadMessage.style.display = &lt;span style="color: rgb(163,21,21)"&gt;''&lt;/span&gt;;
            filPhoto.focus();
            &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt;;
        }

        beginPhotoUploadProgress();
        _ifrPhoto.contentWindow.document.getElementById(&lt;span style="color: rgb(163,21,21)"&gt;'photoUpload'&lt;/span&gt;).submit();
        _divFrame.style.display = &lt;span style="color: rgb(163,21,21)"&gt;'none'&lt;/span&gt;;
    }
}&lt;/pre&gt;
&lt;p&gt;Once the &lt;font face="Courier New"&gt;iframe&lt;/font&gt; is loaded we are setting few module level variables (All module level variables are prefixed with _ (underscore) character in this example) to DOM elements, we are also getting the reference of the Upload button which is in the &lt;font face="Courier New"&gt;iframe&lt;/font&gt; and creating its &lt;font face="Courier New"&gt;click&lt;/font&gt; handler. In the click handler first we are doing few basic validation such as the file upload control is not empty or the file that is specified has a valid image file extension. Once the validation qualifies then we are calling the &lt;font face="Courier New"&gt;beginPhotoUploadProgress&lt;/font&gt; function (discussed next) and submitting the iframe form. The &lt;font face="Courier New"&gt;beginPhotoUploadProgress&lt;/font&gt; function is the first of three functions which are used to show the dummy progress bar. Let us see how these functions are written:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; beginPhotoUploadProgress()
{
    _divUploadProgress.style.display = &lt;span style="color: rgb(163,21,21)"&gt;''&lt;/span&gt;;
    clearPhotoUploadProgress();
    _photoUploadProgressTimer = setTimeout(updatePhotoUploadProgress, PROGRESS_INTERVAL);
}

&lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; clearPhotoUploadProgress()
{
    &lt;span style="color: rgb(0,0,255)"&gt;for&lt;/span&gt; (&lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; i = 1; i &amp;lt;= _maxLoop; i++)
    {
        document.getElementById(&lt;span style="color: rgb(163,21,21)"&gt;'tdProgress'&lt;/span&gt; + i).style.backgroundColor = &lt;span style="color: rgb(163,21,21)"&gt;'transparent'&lt;/span&gt;;
    }

    document.getElementById(&lt;span style="color: rgb(163,21,21)"&gt;'tdProgress1'&lt;/span&gt;).style.backgroundColor = PROGRESS_COLOR;
    _loopCounter = 1;
}

&lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; updatePhotoUploadProgress()
{
    _loopCounter += 1;

    &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (_loopCounter &amp;lt;= _maxLoop)
    {
        document.getElementById(&lt;span style="color: rgb(163,21,21)"&gt;'tdProgress'&lt;/span&gt; + _loopCounter).style.backgroundColor = PROGRESS_COLOR;
    }
    &lt;span style="color: rgb(0,0,255)"&gt;else&lt;/span&gt; 
    {
        clearPhotoUploadProgress();
    }

    &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (_photoUploadProgressTimer)
    {
        clearTimeout(_photoUploadProgressTimer);
    }

    _photoUploadProgressTimer = setTimeout(updatePhotoUploadProgress, PROGRESS_INTERVAL);
}&lt;/pre&gt;
&lt;p&gt;As we can see we are basically using the timer (&lt;font face="Courier New"&gt;window.setTimeout&lt;/font&gt;) to show the dummy progress in these functions. Now lets see what happens in the server side when the &lt;font face="Courier New"&gt;iframe&lt;/font&gt; page posts.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;const&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; SCRIPT_TEMPLATE = &lt;span style="color: rgb(163,21,21)"&gt;"&amp;lt;"&lt;/span&gt; + &lt;span style="color: rgb(163,21,21)"&gt;"script "&lt;/span&gt; + &lt;span style="color: rgb(163,21,21)"&gt;"type=\"text/javascript\"&amp;gt;window.parent.photoUploadComplete('{0}', {1});"&lt;/span&gt; + &lt;span style="color: rgb(163,21,21)"&gt;"&amp;lt;"&lt;/span&gt; + &lt;span style="color: rgb(163,21,21)"&gt;"/script"&lt;/span&gt; + &lt;span style="color: rgb(163,21,21)"&gt;"&amp;gt;"&lt;/span&gt;;

&lt;span style="color: rgb(0,0,255)"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; Page_Load(&lt;span style="color: rgb(0,0,255)"&gt;object&lt;/span&gt; sender, &lt;span style="color: rgb(43,145,175)"&gt;EventArgs&lt;/span&gt; e)
{
    &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (IsPostBack)
    {
        &lt;span style="color: rgb(0,128,0)"&gt;//Sleeping for 10 seconds, fake delay, You should not it try at home.
&lt;/span&gt;        System.Threading.&lt;span style="color: rgb(43,145,175)"&gt;Thread&lt;/span&gt;.Sleep(10 * 1000);
        UploadPhoto();
    }
}

&lt;span style="color: rgb(0,0,255)"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; UploadPhoto()
{
    &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; script = &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;.Empty;

    &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; ((filPhoto.PostedFile != &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;) &amp;amp;&amp;amp; (filPhoto.PostedFile.ContentLength &amp;gt; 0))
    {
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (!IsValidImageFile(filPhoto))
        {
            script = &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;.Format(SCRIPT_TEMPLATE, &lt;span style="color: rgb(163,21,21)"&gt;"The uploaded file is not a valid image file."&lt;/span&gt;, &lt;span style="color: rgb(163,21,21)"&gt;"true"&lt;/span&gt;);
        }
    }
    &lt;span style="color: rgb(0,0,255)"&gt;else
&lt;/span&gt;    {
        script = &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;.Format(SCRIPT_TEMPLATE, &lt;span style="color: rgb(163,21,21)"&gt;"Please specify a valid file."&lt;/span&gt;, &lt;span style="color: rgb(163,21,21)"&gt;"true"&lt;/span&gt;);
    }

    &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;.IsNullOrEmpty(script))
    {
        &lt;span style="color: rgb(0,128,0)"&gt;//Uploaded file is valid, now we can do whatever we like to do, copying it file system,
&lt;/span&gt;        &lt;span style="color: rgb(0,128,0)"&gt;//saving it in db etc.

&lt;/span&gt;        &lt;span style="color: rgb(0,128,0)"&gt;//Your Logic goes here

&lt;/span&gt;        script = &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;.Format(SCRIPT_TEMPLATE, &lt;span style="color: rgb(163,21,21)"&gt;"Photo uploaded."&lt;/span&gt;, &lt;span style="color: rgb(163,21,21)"&gt;"false"&lt;/span&gt;);
    }

    &lt;span style="color: rgb(0,128,0)"&gt;//Now inject the script which will fire when the page is refreshed.
&lt;/span&gt;    ClientScript.RegisterStartupScript(&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;.GetType(), &lt;span style="color: rgb(163,21,21)"&gt;"uploadNotify"&lt;/span&gt;, script);
}

&lt;span style="color: rgb(0,0,255)"&gt;private&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;bool&lt;/span&gt; IsValidImageFile(&lt;span style="color: rgb(43,145,175)"&gt;HtmlInputFile&lt;/span&gt; file)
{
    &lt;span style="color: rgb(0,0,255)"&gt;try
&lt;/span&gt;    {
        &lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; (&lt;span style="color: rgb(43,145,175)"&gt;Bitmap&lt;/span&gt; bmp = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Bitmap&lt;/span&gt;(file.PostedFile.InputStream))
        {
            &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;true&lt;/span&gt;;
        }
    }
    &lt;span style="color: rgb(0,0,255)"&gt;catch&lt;/span&gt; (&lt;span style="color: rgb(43,145,175)"&gt;ArgumentException&lt;/span&gt;)
    {
        &lt;span style="color: rgb(0,128,0)"&gt;//throws exception if not valid image
&lt;/span&gt;    }

    &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt;;
}
&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;In the server side we are first doing some basic validation such as the file upload control has file and the file is a valid image file. Once the validation is done we are injecting some javascript which will be executed when the page is loaded in the browser. The javascript calls the main page &lt;font face="Courier New"&gt;photoUploadComplete&lt;/font&gt; function which shows the success/failure or the validation message of the upload. Lets see the javascript function &lt;font face="Courier New"&gt;photoUploadComplete&lt;/font&gt; of the main page.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; photoUploadComplete(message, isError)
{
    clearPhotoUploadProgress();

    &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (_photoUploadProgressTimer)
    {
        clearTimeout(_photoUploadProgressTimer);
    }

    _divUploadProgress.style.display = &lt;span style="color: rgb(163,21,21)"&gt;'none'&lt;/span&gt;;
    _divUploadMessage.style.display = &lt;span style="color: rgb(163,21,21)"&gt;'none'&lt;/span&gt;;
    _divFrame.style.display = &lt;span style="color: rgb(163,21,21)"&gt;''&lt;/span&gt;;

    &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (message.length)
    {
        &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; color = (isError) ? &lt;span style="color: rgb(163,21,21)"&gt;'#ff0000'&lt;/span&gt; : &lt;span style="color: rgb(163,21,21)"&gt;'#008000'&lt;/span&gt;;

        _divUploadMessage.innerHTML = &lt;span style="color: rgb(163,21,21)"&gt;'&amp;lt;span style=\"color:'&lt;/span&gt; + color + &lt;span style="color: rgb(163,21,21)"&gt;'\;font-weight:bold"&amp;gt;'&lt;/span&gt; + message + &lt;span style="color: rgb(163,21,21)"&gt;'&amp;lt;/span&amp;gt;'&lt;/span&gt;;
        _divUploadMessage.style.display = &lt;span style="color: rgb(163,21,21)"&gt;''&lt;/span&gt;;

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (isError)
        {
            _ifrPhoto.contentWindow.document.getElementById(&lt;span style="color: rgb(163,21,21)"&gt;'filPhoto'&lt;/span&gt;).focus();
        }
    }
}&lt;/pre&gt;
&lt;p&gt;The function simply hides the progress bar and shows the upload control then it shows the message in colored text which is sent from the server.&lt;/p&gt;
&lt;p&gt;I hope you can easily implment it in Ajax UpdatePanel, if not please let me know, I will show it in next post.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download&lt;/strong&gt; : &lt;a href="http://www.box.net/shared/d72om3h1g2" target="_blank"&gt;Complete Solution&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/rashid/archive/2007/08/01/Create-An-Ajax-Style-File-Upload.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/rashid/archive/2007/08/01/Create-An-Ajax-Style-File-Upload.aspx" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114308"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114308" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/rashid/aggbug/114308.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kazi Manzur Rashid</dc:creator>
            <guid>http://geekswithblogs.net/rashid/archive/2007/08/01/Create-An-Ajax-Style-File-Upload.aspx</guid>
            <pubDate>Wed, 01 Aug 2007 08:36:58 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rashid/comments/114308.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rashid/archive/2007/08/01/Create-An-Ajax-Style-File-Upload.aspx#feedback</comments>
            <slash:comments>70</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/rashid/comments/commentRss/114308.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rashid/services/trackbacks/114308.aspx</trackback:ping>
        </item>
        <item>
            <title>Implement Yahoo's YSlow in your Asp.net pages</title>
            <link>http://geekswithblogs.net/rashid/archive/2007/07/29/Implement-Yahoos-YSlow-in-your-Asp.net-pages.aspx</link>
            <description>&lt;p&gt;I have got quite a bit of comments and feedbacks on my &lt;a href="http://geekswithblogs.net/rashid/archive/2007/07/25/Combine-Multiple-JavaScript-and-CSS-Files-and-Remove-Overheads.aspx"&gt;previous post&lt;/a&gt; where I shown how to combine multiple JS and CSS Files into one. So I decided to enhance it a bit more. Now it Supports:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;GZip or Deflate Compression based upon the browser header. Can be turned on/off from web.config  &lt;/li&gt;&lt;li&gt;Minifier for both JS and CSS files. Although it is recommended to keep separate version of these files for both development and production instead of minifying it runtime. There are plenty of online and offline tool available to do it. This can be also turned on/off from web.config.  &lt;/li&gt;&lt;li&gt;New Setting in the web.config for Cache Duration instead of hardcoding it in the code.&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;If you have checked the recent &lt;a href="http://com3.devnet.re3.yahoo.com/yslow/" target="_blank"&gt;YSlow&lt;/a&gt; of Yahoo which works on top of Firebug, you already know that the above items are highly recommended for creating High Performance web applications.&lt;/p&gt; &lt;p&gt;&lt;strong&gt;Download&lt;/strong&gt;: &lt;a href="http://www.box.net/shared/3yre9xf7my" target="_blank"&gt;Enhanced Version&lt;/a&gt;&lt;/p&gt; &lt;p&gt;&lt;a target="_blank" href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/rashid/archive/2007/07/29/Implement-Yahoos-YSlow-in-your-Asp.net-pages.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/rashid/archive/2007/07/29/Implement-Yahoos-YSlow-in-your-Asp.net-pages.aspx" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114250"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114250" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/rashid/aggbug/114250.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kazi Manzur Rashid</dc:creator>
            <guid>http://geekswithblogs.net/rashid/archive/2007/07/29/Implement-Yahoos-YSlow-in-your-Asp.net-pages.aspx</guid>
            <pubDate>Sun, 29 Jul 2007 10:14:46 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rashid/comments/114250.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rashid/archive/2007/07/29/Implement-Yahoos-YSlow-in-your-Asp.net-pages.aspx#feedback</comments>
            <slash:comments>3</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/rashid/comments/commentRss/114250.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rashid/services/trackbacks/114250.aspx</trackback:ping>
        </item>
        <item>
            <title>Combine Multiple JavaScript and CSS Files and Remove Overheads</title>
            <link>http://geekswithblogs.net/rashid/archive/2007/07/25/Combine-Multiple-JavaScript-and-CSS-Files-and-Remove-Overheads.aspx</link>
            <description>&lt;p&gt;When developing a large web application especially if it is Ajax enabled, we often ended up with a larger number of JavaScript and Cascading Stylesheet files and it is quite common that more than one JavaScript file is involved for a single functionality. For example, if you are using DataTable widget of &lt;a href="http://developer.yahoo.com/yui/" target="_blank"&gt;Yahoo User Interface&lt;/a&gt; you have to add &lt;font face="Courier New"&gt;yahoo-dom-event.js, connection-min.js, dragdrop-min.js, json.js, datasource-beta-min.js, datatable-beta-min.js&lt;/font&gt; (&lt;a href="http://developer.yahoo.com/yui/datatable/" target="_blank"&gt;as per the example&lt;/a&gt;). When a browser encounters an external resource file such as Image, CSS, JS it opens a separate connection to download the file which actually add extra overhead both to server and the browser. To minimize it we can manually combine multiple JS and CSS file into a single large file, but this makes development life harder. Instead we can programmatically combine these files which we will see in the next section.&lt;/p&gt; &lt;p&gt;To combine these resource file we can utilize the Generic Handler (&lt;font face="Courier New"&gt;.ashx&lt;/font&gt;)  file which comes with the Asp.net, we can also put some directive in the &lt;font face="Courier New"&gt;web.config&lt;/font&gt; file to conditionally combines the resource files depending upon the settings. First, lets see the &lt;font face="Courier New"&gt;web.config&lt;/font&gt; file.&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;appSettings&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;add&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;key&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;UseFileSet&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;true&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;add&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;key&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;VersionNo&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;1.0&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;add&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;key&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;FileSet_CSS_Style1&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;Css/StyleSheet1.css,Css/StyleSheet2.css,Css/StyleSheet3.css,Css/StyleSheet4.css&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; /&amp;gt;
  &amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;add&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;key&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;FileSet_JS_Functionality1&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; &lt;/span&gt;&lt;span style="color: rgb(255,0,0)"&gt;value&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;=&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt;Scripts/JScript1.js,Scripts/JScript2.js,Scripts/JScript3.js,Scripts/JScript4.js&lt;/span&gt;"&lt;span style="color: rgb(0,0,255)"&gt; /&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;appSettings&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As you can see there three kind of settings, first whether we will use the file set which is specified in the consequent settings, second the version number which we will discuss later and third different file sets. Each fileset contains the fileset name as the key and files location in comma separated value. Now lets see how do we embed this resource files in an &lt;font face="Courier New"&gt;aspx&lt;/font&gt; page:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="background: rgb(255,238,98)"&gt;&amp;lt;%&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (ResourceHandler.UseFileSet)
   {
&lt;span style="background: rgb(255,238,98)"&gt;%&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;link&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text/css"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;href&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="ResourceHandler.ashx?v=&lt;/span&gt;&lt;span style="background: rgb(255,238,98)"&gt;&amp;lt;%&lt;/span&gt;= ResourceHandler.VersionNo &lt;span style="background: rgb(255,238,98)"&gt;%&amp;gt;&lt;span style="color: rgb(0,0,255)"&gt;&lt;/span&gt;&amp;amp;fileSet=FileSet_CSS_Style1&amp;amp;type=text/css"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;rel&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Stylesheet"/&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text/javascript"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;src&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="ResourceHandler.ashx?v=&lt;/span&gt;&lt;span style="background: rgb(255,238,98)"&gt;&amp;lt;%&lt;/span&gt;= ResourceHandler.VersionNo &lt;span style="background: rgb(255,238,98)"&gt;%&amp;gt;&lt;span style="color: rgb(0,0,255)"&gt;&lt;/span&gt;&amp;amp;fileSet=JS_Functionality1&amp;amp;type=application/x-javascript"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="background: rgb(255,238,98)"&gt;&amp;lt;%
&lt;/span&gt;   }
   &lt;span style="color: rgb(0,0,255)"&gt;else
&lt;/span&gt;   {
&lt;span style="background: rgb(255,238,98)"&gt;%&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;link&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;href&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Css/StyleSheet1.css"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;rel&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="stylesheet"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text/css"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;link&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;href&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Css/StyleSheet2.css"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;rel&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="stylesheet"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text/css"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;link&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;href&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Css/StyleSheet3.css"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;rel&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="stylesheet"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text/css"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;link&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;href&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Css/StyleSheet4.css"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;rel&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="stylesheet"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text/css"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text/javascript"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;src&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Scripts/JScript1.js"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text/javascript"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;src&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Scripts/JScript2.js"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text/javascript"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;src&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Scripts/JScript3.js"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text/javascript"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;src&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Scripts/JScript4.js"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;&lt;span style="background: rgb(255,238,98)"&gt;&amp;lt;%
&lt;/span&gt;   }
&lt;span style="background: rgb(255,238,98)"&gt;%&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;As you can see we are using Asp.net syntax to conditionally add these resource file depending upon the settings. When we are in development mode we can turn it off  from the &lt;font face="Courier New"&gt;web.config&lt;/font&gt; file. But the problem with using generic resource handler is the files never gets cached in the browser. So our generic handler must also inject proper caching headers along with combining files. Now lets see how the generic handler is implemented:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="background: rgb(255,238,98)"&gt;&amp;lt;%&lt;span style="color: rgb(0,0,255)"&gt;&lt;/span&gt;@&lt;/span&gt; &lt;span style="color: rgb(163,21,21)"&gt;WebHandler&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;Language&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="C#"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;Class&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="ResourceHandler"&lt;/span&gt; &lt;span style="background: rgb(255,238,98)"&gt;%&amp;gt;
&lt;span style="color: rgb(0,0,255)"&gt;&lt;/span&gt;using&lt;/span&gt; System;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.IO;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Web;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Configuration;

&lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;ResourceHandler&lt;/span&gt; : &lt;span style="color: rgb(43,145,175)"&gt;IHttpHandler
&lt;/span&gt;{
    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;bool&lt;/span&gt; UseFileSet
    {
        &lt;span style="color: rgb(0,0,255)"&gt;get
&lt;/span&gt;        {
            &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Convert&lt;/span&gt;.ToBoolean(&lt;span style="color: rgb(43,145,175)"&gt;ConfigurationManager&lt;/span&gt;.AppSettings[&lt;span style="color: rgb(163,21,21)"&gt;"UseFileSet"&lt;/span&gt;]);
        }
    }

    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; VersionNo
    {
        &lt;span style="color: rgb(0,0,255)"&gt;get
&lt;/span&gt;        {
            &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;ConfigurationManager&lt;/span&gt;.AppSettings[&lt;span style="color: rgb(163,21,21)"&gt;"VersionNo"&lt;/span&gt;];
        }
    }

    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;bool&lt;/span&gt; IsReusable
    {
        &lt;span style="color: rgb(0,0,255)"&gt;get
&lt;/span&gt;        {
            &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;true&lt;/span&gt;;
        }
    }

    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; ProcessRequest (&lt;span style="color: rgb(43,145,175)"&gt;HttpContext&lt;/span&gt; context)
    {
        &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; fileSet = context.Request.QueryString[&lt;span style="color: rgb(163,21,21)"&gt;"fileSet"&lt;/span&gt;];

        &lt;span style="color: rgb(0,128,0)"&gt;//Basic Validation
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;.IsNullOrEmpty(fileSet))
        {
            &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt;;
        }

        &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; contetType = context.Request.QueryString[&lt;span style="color: rgb(163,21,21)"&gt;"type"&lt;/span&gt;];

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;.IsNullOrEmpty(contetType))
        {
            &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt;;
        }

        &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; files = &lt;span style="color: rgb(43,145,175)"&gt;ConfigurationManager&lt;/span&gt;.AppSettings[&lt;span style="color: rgb(163,21,21)"&gt;"FileSet_"&lt;/span&gt; + fileSet];

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;.IsNullOrEmpty(files))
        {
            &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt;;
        }

        &lt;span style="color: rgb(0,128,0)"&gt;//Get the list of files specified in the FileSet
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt;[] fileNames = files.Split(&lt;span style="color: rgb(163,21,21)"&gt;','&lt;/span&gt;);

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; ((fileNames != &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;) &amp;amp;&amp;amp; (fileNames.Length &amp;gt; 0))
        {
            &lt;span style="color: rgb(0,128,0)"&gt;//Write each files in the response
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;for&lt;/span&gt; (&lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; i = 0; i &amp;lt; fileNames.Length; i++)
            {
                context.Response.Write(&lt;span style="color: rgb(43,145,175)"&gt;File&lt;/span&gt;.ReadAllText(context.Server.MapPath(fileNames[i])));
            }

            &lt;span style="color: rgb(0,128,0)"&gt;//Set the content type
&lt;/span&gt;            context.Response.ContentType = contetType;

            &lt;span style="color: rgb(0,128,0)"&gt;// Cache the resource for 7 Days
&lt;/span&gt;            &lt;span style="color: rgb(43,145,175)"&gt;CacheUtility&lt;/span&gt;.Cache(&lt;span style="color: rgb(43,145,175)"&gt;TimeSpan&lt;/span&gt;.FromDays(7));
        }
    }
}&lt;/pre&gt;
&lt;p&gt;As we can see the Handler contains some static property which we used when embedding in the aspx files.  The file merging is done in the &lt;font face="Courier New"&gt;ProcessRequest&lt;/font&gt; method. In this method we are reading the physical files which is specified in the web.config fileset and writing it in the Asp.net &lt;font face="Courier New"&gt;Response&lt;/font&gt; object and at the end we are using a helper class &lt;font face="Courier New"&gt;CacheUtility&lt;/font&gt; to cache the response. Now let see how the this class is implemented:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Web;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Reflection;

&lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;CacheUtility
&lt;/span&gt;{
    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; Cache(&lt;span style="color: rgb(43,145,175)"&gt;TimeSpan&lt;/span&gt; duration)
    {
        &lt;span style="color: rgb(43,145,175)"&gt;HttpCachePolicy&lt;/span&gt; cache = &lt;span style="color: rgb(43,145,175)"&gt;HttpContext&lt;/span&gt;.Current.Response.Cache;

        &lt;span style="color: rgb(43,145,175)"&gt;FieldInfo&lt;/span&gt; maxAgeField = cache.GetType().GetField(&lt;span style="color: rgb(163,21,21)"&gt;"_maxAge"&lt;/span&gt;, &lt;span style="color: rgb(43,145,175)"&gt;BindingFlags&lt;/span&gt;.Instance | &lt;span style="color: rgb(43,145,175)"&gt;BindingFlags&lt;/span&gt;.NonPublic);
        maxAgeField.SetValue(cache, duration);

        cache.SetCacheability(&lt;span style="color: rgb(43,145,175)"&gt;HttpCacheability&lt;/span&gt;.Public);
        cache.SetExpires(&lt;span style="color: rgb(43,145,175)"&gt;DateTime&lt;/span&gt;.Now.Add(duration));
        cache.SetMaxAge(duration);
        cache.AppendCacheExtension(&lt;span style="color: rgb(163,21,21)"&gt;"must-revalidate, proxy-revalidate"&lt;/span&gt;);
    }
}
&lt;/pre&gt;
&lt;p&gt;As you can see we are not only using the regular caching methods of Asp.net, we are also using some reflection code to set the proper &lt;font face="Courier New"&gt;cache-control&lt;/font&gt; header. You can find the reason why the reflection is used from these two links &lt;a href="http://www.codeproject.com/useritems/ScriptMethodClientCache.asp" target="_blank"&gt;Client-side caching for script methods access in ASP.NET AJAX&lt;/a&gt; and &lt;a href="http://www.codeproject.com/Ajax/aspnetajaxtips.asp" target="_blank"&gt;ASP.NET AJAX under the hood secrets&lt;/a&gt;. If you want to know more about the &lt;font face="Courier New"&gt;cache-control&lt;/font&gt; header then read &lt;a href="http://www.mnot.net/cache_docs/" target="_blank"&gt;Caching Details&lt;/a&gt;. If any of the files get modified then update the version number in &lt;font face="Courier New"&gt;web.config&lt;/font&gt;, it will ensure that the latest files get downloaded due to the query string.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download&lt;/strong&gt;: &lt;a href="http://www.box.net/shared/40q6kq38m8" target="_blank"&gt;Complete Solution&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/rashid/archive/2007/07/25/Combine-Multiple-JavaScript-and-CSS-Files-and-Remove-Overheads.aspx" target="_blank"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/rashid/archive/2007/07/25/Combine-Multiple-JavaScript-and-CSS-Files-and-Remove-Overheads.aspx" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114161"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114161" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/rashid/aggbug/114161.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kazi Manzur Rashid</dc:creator>
            <guid>http://geekswithblogs.net/rashid/archive/2007/07/25/Combine-Multiple-JavaScript-and-CSS-Files-and-Remove-Overheads.aspx</guid>
            <pubDate>Wed, 25 Jul 2007 20:57:46 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rashid/comments/114161.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rashid/archive/2007/07/25/Combine-Multiple-JavaScript-and-CSS-Files-and-Remove-Overheads.aspx#feedback</comments>
            <slash:comments>12</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/rashid/comments/commentRss/114161.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rashid/services/trackbacks/114161.aspx</trackback:ping>
        </item>
        <item>
            <title>Cancel a Web Service Call in Asp.net Ajax</title>
            <link>http://geekswithblogs.net/rashid/archive/2007/07/14/Cancel-a-Web-Service-Call-in-Asp.net-Ajax.aspx</link>
            <description>&lt;p&gt;In this post I will show you how to cancel a web Service call after it is invoked, I will also provide you some interesting findings (Maybe a Bug) in Asp.net Ajax Network Layer. There are plenty of examples available on how to abort an UpdatePanel AsyncPostback but none for the WebService. The following will show you how to do it.&lt;/p&gt; &lt;p&gt;Since we are going to cancel a call we need a  web method which wait for a long time to complete:&lt;/p&gt; &lt;p&gt;The Web Method:&lt;/p&gt;&lt;pre class="code"&gt;[&lt;span style="color: rgb(43,145,175)"&gt;WebMethod&lt;/span&gt;()]
&lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; LongOperation(&lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; miliseconds)
{
    System.Threading.&lt;span style="color: rgb(43,145,175)"&gt;Thread&lt;/span&gt;.Sleep(miliseconds);
    &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(163,21,21)"&gt;"Task Complete"&lt;/span&gt;;
}&lt;/pre&gt;
&lt;p&gt;Now lets check the client part. If you are already familiar with Web Service calling in JavaScript, I hope you know that there is always a JavaScript Proxy class involved for that Web Service. This Proxy class is inherited from the &lt;font face="Courier New"&gt;Sys.Net.WebServiceProxy&lt;/font&gt; which contains a single method &lt;font face="Courier New"&gt;invoke&lt;/font&gt;. If you check the &lt;a href="http://ajax.asp.net/docs/ClientReference/Sys.Net/WebServiceProxyClass/WebServiceProxyInvokeMethod.aspx" target="_blank"&gt;Ajax Documentation&lt;/a&gt; you will find that this &lt;font face="Courier New"&gt;invoke&lt;/font&gt; method returns a &lt;font face="Courier New"&gt;WebRequest&lt;/font&gt; object which is used to call Web Service method, it is also mentioned that this &lt;font face="Courier New"&gt;WebRequest&lt;/font&gt; object can be also used to cancel the call. Now lets see what is the generated Proxy class looks like. You can easily generate the proxy class by appending &lt;font face="Courier New"&gt;/js&lt;/font&gt; in the Web Service URL. &lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; TestService=&lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;() {
TestService.initializeBase(&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;);
&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._timeout = 0;
&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._userContext = &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;;
&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._succeeded = &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;;
&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._failed = &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;;
}
TestService.prototype={
&lt;strong&gt;&lt;font size="3"&gt;LongOperation:&lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(miliseconds,succeededCallback, failedCallback, userContext) {
&lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._invoke(TestService.get_path(), &lt;span style="color: rgb(163,21,21)"&gt;'LongOperation'&lt;/span&gt;,&lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt;,{miliseconds:miliseconds},succeededCallback,failedCallback,userContext); }}
&lt;/font&gt;&lt;/strong&gt;TestService.registerClass(&lt;span style="color: rgb(163,21,21)"&gt;'TestService'&lt;/span&gt;,Sys.Net.WebServiceProxy);
&lt;font size="3"&gt;&lt;strong&gt;TestService._staticInstance = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; TestService();&lt;/strong&gt;&lt;/font&gt;
TestService.set_path = &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(value) { TestService._staticInstance.set_path(value); }
TestService.get_path = &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;() { &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; TestService._staticInstance.get_path(); }
TestService.set_timeout = &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(value) { TestService._staticInstance.set_timeout(value); }
TestService.get_timeout = &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;() { &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; TestService._staticInstance.get_timeout(); }
TestService.set_defaultUserContext = &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(value) { TestService._staticInstance.set_defaultUserContext(value); }
TestService.get_defaultUserContext = &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;() { &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; TestService._staticInstance.get_defaultUserContext(); }
TestService.set_defaultSucceededCallback = &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(value) { TestService._staticInstance.set_defaultSucceededCallback(value); }
TestService.get_defaultSucceededCallback = &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;() { &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; TestService._staticInstance.get_defaultSucceededCallback(); }
TestService.set_defaultFailedCallback = &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(value) { TestService._staticInstance.set_defaultFailedCallback(value); }
TestService.get_defaultFailedCallback = &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;() { &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; TestService._staticInstance.get_defaultFailedCallback(); }
TestService.set_path(&lt;span style="color: rgb(163,21,21)"&gt;"TestService.asmx"&lt;/span&gt;);
&lt;font size="3"&gt;&lt;strong&gt;TestService.LongOperation= &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(miliseconds,onSuccess,onFailed,userContext) {TestService._staticInstance.LongOperation(miliseconds,onSuccess,onFailed,userContext); }
&lt;/strong&gt;&lt;/font&gt;&lt;/pre&gt;
&lt;p&gt;As you can see the LongOperation in protoype section is using the base class(&lt;font face="Courier New"&gt;Sys.Net.WebServiceProxy&lt;/font&gt;) &lt;font face="Courier New"&gt;invoke&lt;/font&gt; method to call the Web method which in turn returns &lt;font face="Courier New"&gt;WebRequest&lt;/font&gt;. The Proxy also has a self instance as a &lt;font face="Courier New"&gt;_staticInstance&lt;/font&gt;. But in later it overrides the method and uses the &lt;font face="Courier New"&gt;_staticInstance&lt;/font&gt; to call the WebMethod but it does not return the &lt;font face="Courier New"&gt;WebRequest(This is the bug) in this case&lt;/font&gt;. So if I write the code as we always did for calling a web method it does not return the &lt;font face="Courier New"&gt;WebReqest&lt;/font&gt; object.&lt;br /&gt;&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; _request = TestService.LongOperation    (       10000, &lt;span style="color: rgb(0,128,0)"&gt;//10 seconds
&lt;/span&gt;                                                    &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(result)
                                                    {
                                                        &lt;span style="color: rgb(0,128,0)"&gt;//
&lt;/span&gt;                                                    },
                                                    &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(exception)
                                                    {
                                                        &lt;span style="color: rgb(0,128,0)"&gt;//
&lt;/span&gt;                                                    }
                                            );&lt;/pre&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;
&lt;p&gt;&lt;br /&gt;But if I call like the following the &lt;font face="Courier New"&gt;WebRequest&lt;/font&gt; is returned:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; _request = TestService._staticInstance.LongOperation  (     10000, &lt;span style="color: rgb(0,128,0)"&gt;//10 seconds
&lt;/span&gt;                                                            &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(result)
                                                            {
                                                                &lt;span style="color: rgb(0,128,0)"&gt;//
&lt;/span&gt;                                                            },
                                                            &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(exception)
                                                            {
                                                                &lt;span style="color: rgb(0,128,0)"&gt;//
&lt;/span&gt;                                                            }
                                                        );&lt;/pre&gt;
&lt;p&gt;Really interesting!!! I have already posted a bug in Asp.net Ajax Forum you can check the progress from this &lt;a href="http://forums.asp.net/t/1133015.aspx" target="_blank"&gt;link&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Now lets check how to cancel the call as we have already got the reference of the &lt;font face="Courier New"&gt;WebRequest&lt;/font&gt; object. To Cancel we can use the following code:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (_request != &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;)
{
    &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; executor = _request.get_executor();

    &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (executor.get_started())
    {
        executor.abort();
    }
}&lt;/pre&gt;
&lt;p&gt;Explanation: Every WebRequest in Ajax Framework has an associated Executor which actually uses the browser &lt;font face="Courier New"&gt;XMLHttpRequest&lt;/font&gt; to call the server side method (An URL).  In the above, first we are getting a reference of that executor then checking if the call is in progress (To be in the safe side), if so then we are invoking &lt;font face="Courier New"&gt;abort&lt;/font&gt; method of that executor which in turns call the &lt;font face="Courier New"&gt;abort&lt;/font&gt; method of the &lt;font face="Courier New"&gt;XMLHttpRequest&lt;/font&gt;.&lt;/p&gt;
&lt;p&gt;Another annoying problem I found after doing the abort the Ajax Framework throws an exception and for this reason the &lt;font face="Courier New"&gt;OnFailure&lt;/font&gt; Callback of the Web method call is executed. So we also need to differentiate between a real exception and an User Defined Abort (May be a button click of the user). For this we have to put some extra check in the failure callback like the following:&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; _request = TestService._staticInstance.LongOperation  (     10000, &lt;span style="color: rgb(0,128,0)"&gt;//10 seconds
&lt;/span&gt;                                                                &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(result)
                                                                {
                                                                    alert(result);
                                                                    $get(&lt;span style="color: rgb(163,21,21)"&gt;'btnInvoke'&lt;/span&gt;).disabled = &lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt;;
                                                                    $get(&lt;span style="color: rgb(163,21,21)"&gt;'btnAbort'&lt;/span&gt;).disabled = &lt;span style="color: rgb(0,0,255)"&gt;true&lt;/span&gt;;
                                                                },
                                                                &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(exception)
                                                                {
                                                                    &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (!_request.get_executor().get_aborted())
                                                                    {
                                                                        alert(exception.get_message());
                                                                    }
                                                                    $get(&lt;span style="color: rgb(163,21,21)"&gt;'btnInvoke'&lt;/span&gt;).disabled = &lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt;;
                                                                    $get(&lt;span style="color: rgb(163,21,21)"&gt;'btnAbort'&lt;/span&gt;).disabled = &lt;span style="color: rgb(0,0,255)"&gt;true&lt;/span&gt;;
                                                                }
                                                            );&lt;/pre&gt;
&lt;p&gt;In the Failure Callback we are again checking if the &lt;font face="Courier New"&gt;WebRequest&lt;/font&gt; Executor has been aborted, if so then it is not an exception rather the user choose to cancel the call.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.box.net/shared/y1fypc3yht" target="_blank"&gt;Download: Complete working sample.&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/rashid/archive/2007/07/14/Cancel-a-Web-Service-Call-in-Asp.net-Ajax.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/rashid/archive/2007/07/14/Cancel-a-Web-Service-Call-in-Asp.net-Ajax.aspx" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=113926"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=113926" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/rashid/aggbug/113926.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kazi Manzur Rashid</dc:creator>
            <guid>http://geekswithblogs.net/rashid/archive/2007/07/14/Cancel-a-Web-Service-Call-in-Asp.net-Ajax.aspx</guid>
            <pubDate>Sat, 14 Jul 2007 10:30:34 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rashid/comments/113926.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rashid/archive/2007/07/14/Cancel-a-Web-Service-Call-in-Asp.net-Ajax.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/rashid/comments/commentRss/113926.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rashid/services/trackbacks/113926.aspx</trackback:ping>
        </item>
        <item>
            <title>SJAX Call</title>
            <link>http://geekswithblogs.net/rashid/archive/2007/07/04/SJAX-Call.aspx</link>
            <description>&lt;p&gt;While visiting &lt;a href="http://forums.asp.net" target="_blank"&gt;Asp.net forum&lt;/a&gt;, I found an &lt;a href="http://forums.asp.net/t/1127870.aspx" target="_blank"&gt;interesting request&lt;/a&gt;, A forum member is trying to implement some validator controls where the member wants to call a Web Service method, since the nature of Asp.net Ajax is asynchronous the call does not return instantly. In the reply, another member from Microsoft provides some code which uses XMLHttpRequest to make a Synchronous call to web service. Certainly it does the Job but there is no flavor of Asp.net Ajax Framework. I am not sure the MS guy really knows that the Asp.net Ajax Framework supports Custom Web Request executor, by default Asp.net Ajax uses Sys.Net.XMLHttpExecutor for server side method calling. So I decide to create a small class which can be used with the Asp.net Ajax Framework to call a Server Side method synchronously. The Following shows the code how to call a server side method synchronously:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; GetWebRequest()
{
    &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; resultElement = $get(&lt;span style="color: rgb(163,21,21)"&gt;'ResultId'&lt;/span&gt;);

    resultElement.innerHTML = &lt;span style="color: rgb(163,21,21)"&gt;''&lt;/span&gt;;

    &lt;span style="color: rgb(0,128,0)"&gt;// Instantiate a WebRequest.
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; wRequest = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; Sys.Net.WebRequest();
    &lt;span style="color: rgb(0,128,0)"&gt;// Set the request URL.
&lt;/span&gt;    wRequest.set_url(&lt;span style="color: rgb(163,21,21)"&gt;'getTarget.aspx'&lt;/span&gt;);
    &lt;span style="color: rgb(0,128,0)"&gt;// Set the request verb.
&lt;/span&gt;    wRequest.set_httpVerb(&lt;span style="color: rgb(163,21,21)"&gt;'GET'&lt;/span&gt;);

    &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; executor = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; Sys.Net.XMLHttpSyncExecutor(); &lt;span style="color: rgb(0,128,0)"&gt;// This is the Custom Executor
&lt;/span&gt;    wRequest.set_executor(executor);
    &lt;span style="color: rgb(0,128,0)"&gt;// Execute the request.
&lt;/span&gt;    wRequest.invoke();

    &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (executor.get_responseAvailable()) 
    {
        &lt;span style="color: rgb(0,128,0)"&gt;// Clear the previous results. 
&lt;/span&gt;        resultElement.innerHTML = &lt;span style="color: rgb(163,21,21)"&gt;''&lt;/span&gt;;
        &lt;span style="color: rgb(0,128,0)"&gt;// Display Web request status. 
&lt;/span&gt;        resultElement.innerHTML += &lt;span style="color: rgb(163,21,21)"&gt;'Status: ['&lt;/span&gt; + executor.get_statusCode() + &lt;span style="color: rgb(163,21,21)"&gt;' '&lt;/span&gt; + executor.get_statusText() + &lt;span style="color: rgb(163,21,21)"&gt;']'&lt;/span&gt; + &lt;span style="color: rgb(163,21,21)"&gt;'&amp;lt;br/&amp;gt;'&lt;/span&gt;;
        &lt;span style="color: rgb(0,128,0)"&gt;// Display Web request headers.
&lt;/span&gt;        resultElement.innerHTML +=  &lt;span style="color: rgb(163,21,21)"&gt;'Headers: '&lt;/span&gt;;
        resultElement.innerHTML += executor.getAllResponseHeaders() + &lt;span style="color: rgb(163,21,21)"&gt;'&amp;lt;br/&amp;gt;'&lt;/span&gt;;
        &lt;span style="color: rgb(0,128,0)"&gt;// Display Web request body.
&lt;/span&gt;        resultElement.innerHTML +=  &lt;span style="color: rgb(163,21,21)"&gt;'Body:'&lt;/span&gt;;

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt;(document.all)
        {
            resultElement.innerText += executor.get_responseData();
        }
        &lt;span style="color: rgb(0,0,255)"&gt;else
&lt;/span&gt;        {
            resultElement.textContent += executor.get_responseData();
        }
    }
}&lt;/pre&gt;
&lt;p&gt;As you can see here is no onComplete handler since this is a synchronous call, I have just ported &lt;a href="http://ajax.asp.net/docs/ViewSample.aspx?sref=Sys.Net.ConnectingEndPoints%23ConnectingEndPoints.aspx" target="_blank"&gt;this example&lt;/a&gt; which is found with Asp.net Ajax Documentation with the Custom executor. The following shows the code of this custom executor.&lt;/p&gt;&lt;pre class="code"&gt;Type.registerNamespace(&lt;span style="color: rgb(163,21,21)"&gt;'Sys.Net'&lt;/span&gt;);

Sys.Net.XMLHttpSyncExecutor = &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;()
{
    Sys.Net.XMLHttpSyncExecutor.initializeBase(&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;);

    &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._started = &lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt;;
    &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._responseAvailable = &lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt;;

    &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._onReceiveHandler = &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;;

    &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._responseData = &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;;
    &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._statusCode = &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;;
    &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._statusText = &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;;
    &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._headers = &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;;
}

Sys.Net.XMLHttpSyncExecutor.prototype =
{
    get_aborted : &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;()
    {
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (arguments.length !== 0) &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.parameterCount();

        &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt;;
    },

    get_responseAvailable : &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;()
    {
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (arguments.length !== 0) &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.parameterCount();

        &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._responseAvailable;
    },

    get_responseData : &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;()
    {
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (arguments.length !== 0) &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.parameterCount();

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (!&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._responseAvailable)
        {
            &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, &lt;span style="color: rgb(163,21,21)"&gt;'get_responseData'&lt;/span&gt;));
        }

        &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._responseData;
    },

    get_started : &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;()
    {
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (arguments.length !== 0) &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.parameterCount();

        &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._started;
    },

    get_statusCode : &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;()
    {
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (arguments.length !== 0) &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.parameterCount();

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (!&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._responseAvailable)
        {
            &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, &lt;span style="color: rgb(163,21,21)"&gt;'get_statusCode'&lt;/span&gt;));
        }

        &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._statusCode;
    },

    get_statusText : &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;()
    {
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (arguments.length !== 0) &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.parameterCount();

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (!&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._responseAvailable)
        {
            &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, &lt;span style="color: rgb(163,21,21)"&gt;'get_statusText'&lt;/span&gt;));
        }

        &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._statusText;
    },

    get_xml : &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;()
    {
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (arguments.length !== 0) &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.parameterCount();

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (!&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._responseAvailable)
        {
            &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, &lt;span style="color: rgb(163,21,21)"&gt;'get_xml'&lt;/span&gt;));
        }

        &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; xml = &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._responseData;

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; ((!xml) || (!xml.documentElement))
        {
            xml = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; XMLDOM(&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._responseData);

            &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; ((!xml) || (!xml.documentElement))
            {
                &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;;
            }
        }
        &lt;span style="color: rgb(0,0,255)"&gt;else&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (navigator.userAgent.indexOf(&lt;span style="color: rgb(163,21,21)"&gt;'MSIE'&lt;/span&gt;) !== -1)
        {
            xml.setProperty(&lt;span style="color: rgb(163,21,21)"&gt;'SelectionLanguage'&lt;/span&gt;, &lt;span style="color: rgb(163,21,21)"&gt;'XPath'&lt;/span&gt;);
        }

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; ((xml.documentElement.namespaceURI === &lt;span style="color: rgb(163,21,21)"&gt;"http://www.mozilla.org/newlayout/xml/parsererror.xml"&lt;/span&gt;) &amp;amp;&amp;amp;
            (xml.documentElement.tagName === &lt;span style="color: rgb(163,21,21)"&gt;"parsererror"&lt;/span&gt;))
        {
            &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;;
        }

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (xml.documentElement.firstChild &amp;amp;&amp;amp; xml.documentElement.firstChild.tagName === &lt;span style="color: rgb(163,21,21)"&gt;"parsererror"&lt;/span&gt;)
        {
            &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;;
        }

        &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; xml;
    },

    executeRequest : &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;()
    {
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (arguments.length !== 0) &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.parameterCount();

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._started)
        {
            &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.invalidOperation(String.format(Sys.Res.cannotCallOnceStarted, &lt;span style="color: rgb(163,21,21)"&gt;'executeRequest'&lt;/span&gt;));
        }

        &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; webRequest = &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;.get_webRequest();

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (webRequest === &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;)
        {
            &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.invalidOperation(Sys.Res.nullWebRequest);
        }

        &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; body = webRequest.get_body();
        &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; headers = webRequest.get_headers();
        &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; verb = webRequest.get_httpVerb();

        &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; xmlHttpRequest = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; XMLHttpRequest();
        &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._onReceiveHandler = Function.createCallback(&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._onReadyStateChange, {sender:&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;, xmlHttp:xmlHttpRequest});
        &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._started = &lt;span style="color: rgb(0,0,255)"&gt;true&lt;/span&gt;;
        xmlHttpRequest.onreadystatechange = &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._onReceiveHandler;
        xmlHttpRequest.open(verb, webRequest.getResolvedUrl(), &lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt;); &lt;span style="color: rgb(0,128,0)"&gt;// False to call Synchronously

&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (headers)
        {
            &lt;span style="color: rgb(0,0,255)"&gt;for&lt;/span&gt; (&lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; header &lt;span style="color: rgb(0,0,255)"&gt;in&lt;/span&gt; headers)
            {
                &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; val = headers[header];

                &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(0,0,255)"&gt;typeof&lt;/span&gt;(val) !== &lt;span style="color: rgb(163,21,21)"&gt;"function"&lt;/span&gt;)
                {
                    xmlHttpRequest.setRequestHeader(header, val);
                }
            }
        }

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (verb.toLowerCase() === &lt;span style="color: rgb(163,21,21)"&gt;"post"&lt;/span&gt;)
        {
            &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; ((headers === &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;) || !headers[&lt;span style="color: rgb(163,21,21)"&gt;'Content-Type'&lt;/span&gt;])
            {
                xmlHttpRequest.setRequestHeader(&lt;span style="color: rgb(163,21,21)"&gt;'Content-Type'&lt;/span&gt;, &lt;span style="color: rgb(163,21,21)"&gt;'application/x-www-form-urlencoded'&lt;/span&gt;);
            }

            &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (!body)
            {
                body = &lt;span style="color: rgb(163,21,21)"&gt;''&lt;/span&gt;;
            }
        }

        xmlHttpRequest.send(body);
    },

    getAllResponseHeaders : &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;()
    {
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (arguments.length !== 0) &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.parameterCount();

        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (!&lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._responseAvailable)
        {
            &lt;span style="color: rgb(0,0,255)"&gt;throw&lt;/span&gt; Error.invalidOperation(String.format(Sys.Res.cannotCallBeforeResponse, &lt;span style="color: rgb(163,21,21)"&gt;'getAllResponseHeaders'&lt;/span&gt;));
        }

        &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;this&lt;/span&gt;._headers;
    },

    _onReadyStateChange : &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt;(e)
    {
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (e.xmlHttp.readyState === 4)
        {
            e.sender._responseAvailable = &lt;span style="color: rgb(0,0,255)"&gt;true&lt;/span&gt;;
            e.sender._responseData = e.xmlHttp.responseText;
            e.sender._statusCode = e.xmlHttp.status;
            e.sender._statusText = e.xmlHttp.statusText;
            e.sender._headers = e.xmlHttp.getAllResponseHeaders();

            e.xmlHttp.onreadystatechange = Function.emptyMethod;
            e.sender._onReceiveHandler = &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;;

            e.sender._started = &lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt;;
        }
    }
}

Sys.Net.XMLHttpSyncExecutor.registerClass(&lt;span style="color: rgb(163,21,21)"&gt;'Sys.Net.XMLHttpSyncExecutor'&lt;/span&gt;, Sys.Net.WebRequestExecutor);

&lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (&lt;span style="color: rgb(0,0,255)"&gt;typeof&lt;/span&gt;(Sys) != &lt;span style="color: rgb(163,21,21)"&gt;'undefined'&lt;/span&gt;)
{
    Sys.Application.notifyScriptLoaded();
}&lt;/pre&gt;
&lt;p&gt;You can also download the full code listing from this &lt;a href="http://www.box.net/shared/n33ijgss4i" target="_blank"&gt;link&lt;a&gt;. Since the nature of the Call is Synchronous we can call it Synchronous JavaScript and XML or SJAX.&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.dotnetkicks.com/kick/?url=http://geekswithblogs.net/rashid/archive/2007/07/04/SJAX-Call.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/rashid/archive/2007/07/04/SJAX-Call.aspx" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=113673"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=113673" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/rashid/aggbug/113673.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kazi Manzur Rashid</dc:creator>
            <guid>http://geekswithblogs.net/rashid/archive/2007/07/04/SJAX-Call.aspx</guid>
            <pubDate>Wed, 04 Jul 2007 23:57:09 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rashid/comments/113673.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rashid/archive/2007/07/04/SJAX-Call.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/rashid/comments/commentRss/113673.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rashid/services/trackbacks/113673.aspx</trackback:ping>
        </item>
        <item>
            <title>Check User Name in Ajax way</title>
            <link>http://geekswithblogs.net/rashid/archive/2007/06/30/Check-User-Name-in-Ajax-way.aspx</link>
            <description>&lt;p&gt;While visiting the Asp.net Ajax forum I found quite a few post on the User Name Checking when creating an User. This is very common request and it is available in many Websites, So I decided to create a small sample. The following shows the full code listing:&lt;/p&gt;&lt;pre class="code"&gt;&lt;span style="background: rgb(255,238,98)"&gt;&amp;lt;%&lt;span style="color: rgb(0,0,255)"&gt;&lt;/span&gt;@&lt;/span&gt; &lt;span style="color: rgb(163,21,21)"&gt;Page&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;Language&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="C#"&lt;/span&gt;&lt;span style="background: rgb(255,238,98)"&gt;%&amp;gt;
&amp;lt;%&lt;span style="color: rgb(0,0,255)"&gt;&lt;/span&gt;@&lt;/span&gt; &lt;span style="color: rgb(163,21,21)"&gt;Import&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;Namespace&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="System.Web.Services"&lt;/span&gt; &lt;span style="background: rgb(255,238,98)"&gt;%&amp;gt;
&amp;lt;%&lt;span style="color: rgb(0,0,255)"&gt;&lt;/span&gt;@&lt;/span&gt; &lt;span style="color: rgb(163,21,21)"&gt;Import&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;Namespace&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="System.Web.Security"&lt;/span&gt; &lt;span style="background: rgb(255,238,98)"&gt;%&amp;gt;
&lt;span style="color: rgb(0,0,255)"&gt;&lt;/span&gt;&amp;lt;!&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;DOCTYPE&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;html&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;PUBLIC&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;    [&lt;span style="color: rgb(43,145,175)"&gt;WebMethod&lt;/span&gt;()]
    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;bool&lt;/span&gt; CheckUserName(&lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; userName)
    {
        &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; (&lt;span style="color: rgb(43,145,175)"&gt;Membership&lt;/span&gt;.GetUser(userName) != &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;);
    }
&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;html&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;xmlns&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="http://www.w3.org/1999/xhtml"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;head&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&lt;/span&gt;Create User&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;title&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;type&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="text/javascript"&amp;gt;

&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; _txtUserName;
    &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; _divStatus;
    &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; _timerHandle;

    &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; pageLoad()
    {
        _txtUserName = $get(&lt;span style="color: rgb(163,21,21)"&gt;'&amp;lt;%= CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("UserName").ClientID %&amp;gt;'&lt;/span&gt;);
        _divStatus = $get(&lt;span style="color: rgb(163,21,21)"&gt;'&amp;lt;%= CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindControl("divStatus").ClientID %&amp;gt;'&lt;/span&gt;);
        $addHandler(_txtUserName, &lt;span style="color: rgb(163,21,21)"&gt;"keyup"&lt;/span&gt;, onKeyUp);
    }

    &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; pageUnload()
    {
        $removeHandler(_txtUserName, &lt;span style="color: rgb(163,21,21)"&gt;"keyup"&lt;/span&gt;, onKeyUp);
        clearTimer();
    }

    &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; onKeyUp(e)
    {
        setupTimer();
    }

    &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; setupTimer()
    {
        clearTimer();
        _timerHandle = window.setTimeout(checkUserName, 500)
    }

    &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; clearTimer()
    {
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (_timerHandle != &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;)
        {
            window.clearTimeout(_timerHandle);
            _timerHandle = &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;;
        }
    }

    &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; checkUserName()
    {
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (_txtUserName.value.length &amp;gt; 2)
        {
            _divStatus.innerHTML = &lt;span style="color: rgb(163,21,21)"&gt;'Checking...'&lt;/span&gt;;
            _divStatus.style.color = &lt;span style="color: rgb(163,21,21)"&gt;'black'&lt;/span&gt;;
            PageMethods.CheckUserName(_txtUserName.value, OnCheckUserNameComplete, OnCheckUserNameError, _txtUserName.value);
        }
    }
    
    &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; OnCheckUserNameComplete(result, userContext)
    {
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (result == &lt;span style="color: rgb(0,0,255)"&gt;true&lt;/span&gt;)
        {
            _divStatus.innerHTML = String.format(&lt;span style="color: rgb(163,21,21)"&gt;'\'{0}\' is already taken'&lt;/span&gt;, userContext);
            _divStatus.style.color = &lt;span style="color: rgb(163,21,21)"&gt;'red'&lt;/span&gt;;
        }
        &lt;span style="color: rgb(0,0,255)"&gt;else
&lt;/span&gt;        {
            _divStatus.innerHTML = String.format(&lt;span style="color: rgb(163,21,21)"&gt;'\'{0}\' is available'&lt;/span&gt;, userContext);
            _divStatus.style.color = &lt;span style="color: rgb(163,21,21)"&gt;'green'&lt;/span&gt;;
        }
    }

    &lt;span style="color: rgb(0,0,255)"&gt;function&lt;/span&gt; OnCheckUserNameError(e)
    {
        _divStatus.innerHTML = e.get_message();
        _divStatus.style.color = &lt;span style="color: rgb(163,21,21)"&gt;'red'&lt;/span&gt;;
    }
    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;script&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;head&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;form&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="form1"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;ScriptManager&lt;/span&gt;  &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="theScriptManager"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;EnablePageMethods&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="true"&amp;gt;
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;ScriptManager&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;CreateUserWizard&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="CreateUserWizard1"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;WizardSteps&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;CreateUserWizardStep&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;table&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;border&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="0"&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;align&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="center"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;colspan&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="2"&amp;gt;&lt;/span&gt;Sign Up for Your New Account&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;align&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="right"&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="UserNameLabel"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;AssociatedControlID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="UserName"&amp;gt;&lt;/span&gt;User Name:&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;TextBox&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="UserName"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;TextBox&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;RequiredFieldValidator&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="UserNameRequired"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ControlToValidate&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="UserName"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ErrorMessage&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="User Name is required."&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ToolTip&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="User Name is required."&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ValidationGroup&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="CreateUserWizard1"&amp;gt;&lt;/span&gt;*&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;RequiredFieldValidator&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;id&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="divStatus"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;align&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="right"&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="PasswordLabel"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;AssociatedControlID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Password"&amp;gt;&lt;/span&gt;Password:&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;TextBox&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Password"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;TextMode&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Password"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;TextBox&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;RequiredFieldValidator&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="PasswordRequired"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ControlToValidate&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Password"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ErrorMessage&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Password is required."&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ToolTip&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Password is required."&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ValidationGroup&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="CreateUserWizard1"&amp;gt;&lt;/span&gt;*&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;RequiredFieldValidator&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;align&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="right"&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="ConfirmPasswordLabel"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;AssociatedControlID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="ConfirmPassword"&amp;gt;&lt;/span&gt;Confirm Password:&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;TextBox&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="ConfirmPassword"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;TextMode&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Password"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;TextBox&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;RequiredFieldValidator&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="ConfirmPasswordRequired"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ControlToValidate&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="ConfirmPassword"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ErrorMessage&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Confirm Password is required."&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ToolTip&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Confirm Password is required."&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ValidationGroup&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="CreateUserWizard1"&amp;gt;&lt;/span&gt;*&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;RequiredFieldValidator&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;align&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="right"&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="EmailLabel"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;AssociatedControlID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Email"&amp;gt;&lt;/span&gt;E-mail:&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;TextBox&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Email"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;TextBox&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;RequiredFieldValidator&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="EmailRequired"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ControlToValidate&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Email"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ErrorMessage&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="E-mail is required."&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ToolTip&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="E-mail is required."&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ValidationGroup&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="CreateUserWizard1"&amp;gt;&lt;/span&gt;*&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;RequiredFieldValidator&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;align&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="right"&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="QuestionLabel"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;AssociatedControlID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Question"&amp;gt;&lt;/span&gt;Security Question:&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;TextBox&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Question"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;TextBox&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;RequiredFieldValidator&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="QuestionRequired"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ControlToValidate&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Question"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ErrorMessage&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Security question is required."&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ToolTip&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Security question is required."&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ValidationGroup&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="CreateUserWizard1"&amp;gt;&lt;/span&gt;*&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;RequiredFieldValidator&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;align&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="right"&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="AnswerLabel"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;AssociatedControlID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Answer"&amp;gt;&lt;/span&gt;Security Answer:&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Label&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;TextBox&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Answer"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;TextBox&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;RequiredFieldValidator&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="AnswerRequired"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ControlToValidate&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Answer"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ErrorMessage&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Security answer is required."&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ToolTip&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Security answer is required."&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ValidationGroup&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="CreateUserWizard1"&amp;gt;&lt;/span&gt;*&lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;RequiredFieldValidator&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;align&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="center"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;colspan&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="2"&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;CompareValidator&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="PasswordCompare"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ControlToCompare&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Password"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ControlToValidate&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="ConfirmPassword"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;Display&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Dynamic"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ErrorMessage&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="The Password and Confirmation Password must match."&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ValidationGroup&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="CreateUserWizard1"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;CompareValidator&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;align&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="center"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;colspan&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="2"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="color: red"&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Literal&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="ErrorMessage"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;EnableViewState&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="False"&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Literal&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;table&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;ContentTemplate&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;CustomNavigationTemplate&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;table&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;border&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="0"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;cellspacing&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="5"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;style&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="width: 100%; height: 100%;"&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;align&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="right"&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;align&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="right"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;colspan&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="0"&amp;gt;
&lt;/span&gt;                                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;Button&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ID&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="StepNextButton"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;CommandName&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="MoveNext"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;Text&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="Create User"&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;ValidationGroup&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="CreateUserWizard1"&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;/&amp;gt;
&lt;/span&gt;                                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;td&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;tr&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;table&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;CustomNavigationTemplate&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;CreateUserWizardStep&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;CompleteWizardStep&lt;/span&gt; &lt;span style="color: rgb(255,0,0)"&gt;runat&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;="server"&amp;gt;
&lt;/span&gt;                    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;CompleteWizardStep&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;                &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;WizardSteps&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;asp&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;:&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;CreateUserWizard&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;div&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;    &lt;span style="color: rgb(0,0,255)"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;form&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;body&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(163,21,21)"&gt;html&lt;/span&gt;&lt;span style="color: rgb(0,0,255)"&gt;&amp;gt;
&lt;/span&gt;&lt;/pre&gt;
&lt;p&gt;The steps are very simple:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Add a CreateUserWizard Control and then Convert the Steps to Custom Template. 
&lt;/li&gt;&lt;li&gt;Add a Div Tag right beside the User Name textbox. 
&lt;/li&gt;&lt;li&gt;Create a Static method which accepts UserName and checks the Membership Provider for the existence. 
&lt;/li&gt;&lt;li&gt;In the ClientSide hook the keydown event of the User name text box. 
&lt;/li&gt;&lt;li&gt;Create a Timer so that we do not have to invoke the Server Side method upon each key press. 
&lt;/li&gt;&lt;li&gt;Call the Server side method  to check the whether the user name is available.&lt;/li&gt;&lt;/ol&gt;
&lt;p&gt;For the clarity i have created a single page example instead of creating Code behind file and Web service. &lt;/p&gt;
&lt;p&gt;You can download it from this link: &lt;a href="http://www.box.net/shared/c5yk6k014l" target="_blank"&gt;CreateUser.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a target="_blank" href="http://www.dotnetkicks.com/kick/?http://geekswithblogs.net/rashid/archive/2007/06/30/Check-User-Name-in-Ajax-way.aspx"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://geekswithblogs.net/rashid/archive/2007/06/30/Check-User-Name-in-Ajax-way.aspx" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=113600"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=113600" border="0"/&gt;&lt;/a&gt;&lt;/p&gt;&lt;iframe src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;PageID=31016&amp;amp;SiteID=1" width=1 height=1 Marginwidth=0 Marginheight=0 Hspace=0 Vspace=0 Frameborder=0 Scrolling=No&gt;
&lt;script language='javascript1.1' src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Browser=NETSCAPE4&amp;amp;NoCache=True&amp;PageID=31016&amp;amp;SiteID=1"&gt;&lt;/script&gt;
&lt;noscript&gt;&lt;a href="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Click&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" target="_blank"&gt;
&lt;img src="http://ads.geekswithblogs.net/a.aspx?ZoneID=5&amp;amp;Task=Get&amp;amp;Mode=HTML&amp;amp;SiteID=1&amp;amp;PageID=31016" width="1" height="1" border="0"  alt=""&gt;&lt;/a&gt;
&lt;/noscript&gt;
&lt;/iframe&gt;
&lt;img src="http://geekswithblogs.net/rashid/aggbug/113600.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kazi Manzur Rashid</dc:creator>
            <guid>http://geekswithblogs.net/rashid/archive/2007/06/30/Check-User-Name-in-Ajax-way.aspx</guid>
            <pubDate>Sun, 01 Jul 2007 01:32:58 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rashid/comments/113600.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rashid/archive/2007/06/30/Check-User-Name-in-Ajax-way.aspx#feedback</comments>
            <slash:comments>4</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/rashid/comments/commentRss/113600.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rashid/services/trackbacks/113600.aspx</trackback:ping>
        </item>
    </channel>
</rss>