<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>Asp.net Ajax</title>
        <link>http://geekswithblogs.net/rashid/category/5923.aspx</link>
        <description>Asp.net Ajax</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>Asp.net Ajax Web Service - Common Issues</title>
            <link>http://geekswithblogs.net/rashid/archive/2007/09/17/Asp.net-Ajax-Web-Service---Common-Issues.aspx</link>
            <description>&lt;p&gt;&lt;a href="http://dotnetslackers.com/columns/ajax/ASPNETAjaxWebService.aspx" target="_blank"&gt;My new article&lt;/a&gt; has been just published for September Ajax Column in &lt;a href="http://dotnetslackers.com" target="_blank"&gt;DotNetSlackers.com&lt;/a&gt;. In this article, I have answered few common issues which I found often discussed in &lt;a href="http://forums.asp.net/1009.aspx" target="_blank"&gt;Asp.net Ajax Web Service Forum&lt;/a&gt;. In this column, I have covered:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Web Service Method, succeededCallback and failedCallback methods signature.  &lt;/li&gt;&lt;li&gt;Complex data type interchange which includes Array, Dictionary, Custom Class.  &lt;ul&gt; &lt;li&gt;GenerateScriptType Attribute  &lt;/li&gt;&lt;li&gt;ScriptIgnore Attribute  &lt;/li&gt;&lt;li&gt;Custom JavaScriptConverter class&lt;/li&gt;&lt;/ul&gt; &lt;/li&gt;&lt;li&gt;Progress Indicator for long running task.  &lt;/li&gt;&lt;li&gt;Soap Header/Custom Http Header&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;&lt;a href="http://dotnetslackers.com/columns/ajax/ASPNETAjaxWebService.aspx" target="_blank"&gt;Check it out&lt;/a&gt;.&lt;/p&gt; &lt;p&gt;&lt;a target="_blank" href="http://www.dotnetkicks.com/kick/?url=http://dotnetslackers.com/columns/ajax/ASPNETAjaxWebService.aspx"&gt;&lt;img src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://dotnetslackers.com/columns/ajax/ASPNETAjaxWebService.aspx" border="0" alt="kick it on DotNetKicks.com" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115410"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=115410" 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/115410.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kazi Manzur Rashid</dc:creator>
            <guid>http://geekswithblogs.net/rashid/archive/2007/09/17/Asp.net-Ajax-Web-Service---Common-Issues.aspx</guid>
            <pubDate>Mon, 17 Sep 2007 20:44:26 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rashid/comments/115410.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rashid/archive/2007/09/17/Asp.net-Ajax-Web-Service---Common-Issues.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/rashid/comments/commentRss/115410.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rashid/services/trackbacks/115410.aspx</trackback:ping>
        </item>
        <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>Book Review - Asp.net Ajax Update Panel</title>
            <link>http://geekswithblogs.net/rashid/archive/2007/08/17/Book-Review---Asp.net-Ajax-Update-Panel.aspx</link>
            <description>&lt;p&gt;I recently did a review on &lt;a href="http://www.oreilly.com/catalog/atlasupc/" target="_blank"&gt;Asp.net Ajax Update Panel of O'Reilly&lt;/a&gt; which is now published in DotNetSlackers.com. &lt;a href="http://dotnetslackers.com/articles/ajax/BookReviewAspNetAjaxUpdatePanelControl.aspx" target="_blank"&gt;Check it out.&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114735"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114735" 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/114735.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kazi Manzur Rashid</dc:creator>
            <guid>http://geekswithblogs.net/rashid/archive/2007/08/17/Book-Review---Asp.net-Ajax-Update-Panel.aspx</guid>
            <pubDate>Fri, 17 Aug 2007 18:27:19 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rashid/comments/114735.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rashid/archive/2007/08/17/Book-Review---Asp.net-Ajax-Update-Panel.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/rashid/comments/commentRss/114735.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rashid/services/trackbacks/114735.aspx</trackback:ping>
        </item>
        <item>
            <title>My New Article - Effective Error Logging in Asp.net Ajax</title>
            <link>http://geekswithblogs.net/rashid/archive/2007/08/13/My-New-Article---Effective-Error-Logging-in-Asp.net-Ajax.aspx</link>
            <description>&lt;p&gt;My latest article &lt;a href="http://dotnetslackers.com/columns/ajax/AspNetAjaxExceptionLogging.aspx" target="_blank"&gt;Asp.net Ajax Error Logging&lt;/a&gt; has been just published in &lt;a href="http://dotnetslackers.com" target="_blank"&gt;DotNetSlackers.com&lt;/a&gt;. In this article, I have demonstrate how to extend Asp.net Ajax Framework to create an effective error logging system which support multiple trace listeners like Enterprise Library. A must read if you are developing or planning to develop an Asp.net Ajax Web Application. You will also find my name in the &lt;a href="http://dotnetslackers.com/columns/ajax/" target="_blank"&gt;Ajax Columns in DotNetSlackers.com&lt;/a&gt; as I have planned to write at least one, preferably two articles each month. If you have any comment on my new article or you have any specific topic which you think I should cover, please do send me your feedback.&lt;/p&gt; &lt;p&gt;&lt;a href="http://www.dotnetkicks.com/kick/?url=http://dotnetslackers.com/columns/ajax/AspNetAjaxExceptionLogging.aspx" target="_blank"&gt;&lt;img alt="kick it on DotNetKicks.com" src="http://www.dotnetkicks.com/Services/Images/KickItImageGenerator.ashx?url=http://dotnetslackers.com/columns/ajax/AspNetAjaxExceptionLogging.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=114593"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114593" 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/114593.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kazi Manzur Rashid</dc:creator>
            <guid>http://geekswithblogs.net/rashid/archive/2007/08/13/My-New-Article---Effective-Error-Logging-in-Asp.net-Ajax.aspx</guid>
            <pubDate>Mon, 13 Aug 2007 05:09:37 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rashid/comments/114593.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rashid/archive/2007/08/13/My-New-Article---Effective-Error-Logging-in-Asp.net-Ajax.aspx#feedback</comments>
            <wfw:commentRss>http://geekswithblogs.net/rashid/comments/commentRss/114593.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rashid/services/trackbacks/114593.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>Asp.net Ajax and VS2003</title>
            <link>http://geekswithblogs.net/rashid/archive/2007/07/21/Asp.net-Ajax-and-VS2003.aspx</link>
            <description>&lt;p&gt;Few days back one of my of ex-colleague called me to know what is the best platform of Ajax to work in VS2003 Project, One of his client wants to implement some Ajax features in his existing application . Is it &lt;a target="_blank" href="http://ajaxpro.info/"&gt;Ajax.net&lt;/a&gt;, &lt;a target="_blank" href="http://www.prototypejs.org/"&gt;Prototype&lt;/a&gt;, &lt;a target="_blank" href="http://jquery.com/"&gt;jQuery&lt;/a&gt; or &lt;a target="_blank" href="http://dojotoolkit.org/"&gt;Dojo&lt;/a&gt;? When I replied him Asp.net Ajax 1.0, he seems bit confused.  Yes we can also use Asp.net Ajax for the older version of VS. However, we will not get the full set of features in those older environment. Let me list those features, which will not be available:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Cannot use Server Side Controls such as ScriptManager, UpdatePanel, UpdateProgress, AjaxControlToolkit etc. &lt;/li&gt;
    &lt;li&gt;Application Service such as Authentication, Profile will not be available. &lt;/li&gt;
    &lt;li&gt;PageMethod will not be available. &lt;/li&gt;
    &lt;li&gt;There will be no Client Side Proxy for the WebServices. &lt;/li&gt;
    &lt;li&gt;The Data will be always transmitted in Xml not in JSON.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Even those missing features we will still able to use rich set of API which includes:&lt;/p&gt;
&lt;ul&gt;
    &lt;li&gt;Base Type Extension &lt;/li&gt;
    &lt;li&gt;Able to Send Request and consume Response to any http endpoint which we see will in later section. &lt;/li&gt;
    &lt;li&gt;Able to use Client Side Components, Extenders and Controls. &lt;/li&gt;
    &lt;li&gt;All other Client Side Library API except &lt;font face="Courier New"&gt;Sys.WebForms&lt;/font&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Let us see how to consume a VS2003 Web Service in Asp Ajax Framework. First download the &lt;a target="_blank" href="http://ajax.asp.net/downloads/library/default.aspx?tabid=47&amp;amp;subtabid=471"&gt;Microsoft AJAX Library&lt;/a&gt; which only contains the JavaScript files. Once downloaded add the &lt;font face="Courier New"&gt;MicrosoftAjax.js&lt;/font&gt; in your Web Project and then your pages where you want to implement Ajax. Next add a Web Service in your Web Project. For shake of the simplicity I will create some basic functions. First create a &lt;font face="Courier New"&gt;WebMethod&lt;/font&gt; which returns the Server DateTime 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; GetCurrentTime()
{
    &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;/pre&gt;
&lt;p&gt;Now lets see how to call this WebMethod from the JavaScript.&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt; getServerTime()
{
    &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; request = &lt;span style="COLOR: rgb(0,0,255)"&gt;new&lt;/span&gt; Sys.Net.WebRequest();

    request.set_url(&lt;span style="COLOR: rgb(163,21,21)"&gt;'SimpleWebService.asmx/GetCurrentTime'&lt;/span&gt;);
    request.set_httpVerb(&lt;span style="COLOR: rgb(163,21,21)"&gt;'POST'&lt;/span&gt;);
    request.add_completed(onGetServerTimeComplete);
    request.invoke()

    $get(&lt;span style="COLOR: rgb(163,21,21)"&gt;'divTime'&lt;/span&gt;).innerHTML = &lt;span style="COLOR: rgb(163,21,21)"&gt;''&lt;/span&gt;;
}

&lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt; onGetServerTimeComplete(executor, eventArgs)
{
    &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (executor.get_responseAvailable())
    {
        $get(&lt;span style="COLOR: rgb(163,21,21)"&gt;'divTime'&lt;/span&gt;).innerHTML = executor.get_xml().documentElement.firstChild.nodeValue;
    }
}&lt;/pre&gt;
&lt;p&gt;First we are creating a &lt;font face="Courier New"&gt;Sys.WebRequest&lt;/font&gt; object and then we are setting the required properties and events such as the end point (The convention is WebServiceUrl/WebMethod), Http Method Post/Get and finally we are binding &lt;font face="Courier New"&gt;onComplete&lt;/font&gt; Handler. In the &lt;font face="Courier New"&gt;onComplete&lt;/font&gt; Handler we are getting the response from the WebRequest's Executor &lt;font face="Courier New"&gt;xml&lt;/font&gt; Property. The Executer is passed in the onComplete Handler and the &lt;font face="Courier New"&gt;xml&lt;/font&gt; property represents an XML DOM Document. You can get more info on WebRequest and Executor from these links &lt;font face="Courier New" color="#000000"&gt;&lt;a target="_blank" href="http://ajax.asp.net/docs/ClientReference/Sys.Net/WebRequestClass/default.aspx"&gt;WebRequest&lt;/a&gt;&lt;/font&gt; and &lt;font face="Courier New" color="#000000"&gt;&lt;a target="_blank" href="http://ajax.asp.net/docs/ClientReference/Sys.Net/XmlHttpExecutorClass/default.aspx"&gt;Executor&lt;/a&gt;&lt;/font&gt;.&lt;/p&gt;
&lt;p&gt;In this section we will see how to pass parameters in the &lt;font face="Courier New"&gt;WebRequest&lt;/font&gt; object when calling a &lt;font face="Courier New"&gt;WebMethod&lt;/font&gt;, For example if your &lt;font face="Courier New"&gt;WebMethod&lt;/font&gt; is like this:&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;bool&lt;/span&gt; IsValidEmails(&lt;span style="COLOR: rgb(0,0,255)"&gt;string&lt;/span&gt; emails)
{
    &lt;span style="COLOR: rgb(0,0,255)"&gt;string&lt;/span&gt;[] emailArray = emails.Split(&lt;span style="COLOR: rgb(163,21,21)"&gt;','&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; emailArray.Length; i++)
    {
        &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; ((!emailArray[i].Contains(&lt;span style="COLOR: rgb(163,21,21)"&gt;"@"&lt;/span&gt;)) || (!emailArray[i].Contains(&lt;span style="COLOR: rgb(163,21,21)"&gt;"."&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;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;/pre&gt;
&lt;p&gt;You can call it in JavaScript like the following:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt; isValidEmail()
{
    &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; requestBody = &lt;span style="COLOR: rgb(163,21,21)"&gt;'emails='&lt;/span&gt; + $get(&lt;span style="COLOR: rgb(163,21,21)"&gt;'txtEmails'&lt;/span&gt;).value;
    &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; request = &lt;span style="COLOR: rgb(0,0,255)"&gt;new&lt;/span&gt; Sys.Net.WebRequest();

    request.set_url(&lt;span style="COLOR: rgb(163,21,21)"&gt;'SimpleWebService.asmx/IsValidEmails'&lt;/span&gt;);
    request.set_httpVerb(&lt;span style="COLOR: rgb(163,21,21)"&gt;'POST'&lt;/span&gt;);
    request.set_body(requestBody);
    request.get_headers()[&lt;span style="COLOR: rgb(163,21,21)"&gt;'Content-Length'&lt;/span&gt;] = requestBody.length;
    request.add_completed(onIsValidEmailComplete);
    request.invoke()

    $get(&lt;span style="COLOR: rgb(163,21,21)"&gt;'divResult'&lt;/span&gt;).innerHTML = &lt;span style="COLOR: rgb(163,21,21)"&gt;'Loading'&lt;/span&gt;;
}

&lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt; onIsValidEmailComplete(executor, eventArgs)
{
    &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (executor.get_responseAvailable())
    {
        $get(&lt;span style="COLOR: rgb(163,21,21)"&gt;'divResult'&lt;/span&gt;).innerHTML = executor.get_xml().documentElement.firstChild.nodeValue;
    }
}&lt;/pre&gt;
&lt;p&gt;The only difference this time comparing to first example is we are setting the body of the request where we are are passing the comma separated email addresses. If you have mulitple parameter then append it with &amp;amp; (Ampersand) character in the request body for example param1=value1&amp;amp;param2=value2 etc.&lt;/p&gt;
&lt;p&gt;So far we have seen only intrinsic data type transfer, now lets check how to send and receive complex data types. Lets create a dummy &lt;font face="Courier New"&gt;WebMethod&lt;/font&gt; which returns an array of &lt;font face="Courier New"&gt;Employee&lt;/font&gt; object like this:&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(43,145,175)"&gt;Employee&lt;/span&gt;[] GetEmployees()
{
    &lt;span style="COLOR: rgb(43,145,175)"&gt;ArrayList&lt;/span&gt; list = &lt;span style="COLOR: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="COLOR: rgb(43,145,175)"&gt;ArrayList&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 = 1; i &amp;lt; 6; i++)
    {
        &lt;span style="COLOR: rgb(43,145,175)"&gt;Employee&lt;/span&gt; emp = &lt;span style="COLOR: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="COLOR: rgb(43,145,175)"&gt;Employee&lt;/span&gt;();

        emp.Name = &lt;span style="COLOR: rgb(0,0,255)"&gt;string&lt;/span&gt;.Format(&lt;span style="COLOR: rgb(163,21,21)"&gt;"Employee Name #{0}"&lt;/span&gt;, i);
        emp.Address = &lt;span style="COLOR: rgb(0,0,255)"&gt;string&lt;/span&gt;.Format(&lt;span style="COLOR: rgb(163,21,21)"&gt;"Employee Address #{0}"&lt;/span&gt;, i);
        emp.Salary = i * 10000;

        list.Add(emp);
    }

    &lt;span style="COLOR: rgb(0,0,255)"&gt;return&lt;/span&gt; (&lt;span style="COLOR: rgb(43,145,175)"&gt;Employee&lt;/span&gt;[])list.ToArray(&lt;span style="COLOR: rgb(0,0,255)"&gt;typeof&lt;/span&gt;(&lt;span style="COLOR: rgb(43,145,175)"&gt;Employee&lt;/span&gt;));
}&lt;/pre&gt;
&lt;p&gt;Now call this WebMethod from JavaScript like this:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt; getEmployeeList()
{
    &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; request = &lt;span style="COLOR: rgb(0,0,255)"&gt;new&lt;/span&gt; Sys.Net.WebRequest();

    request.set_url(&lt;span style="COLOR: rgb(163,21,21)"&gt;'SimpleWebService.asmx/GetEmployees'&lt;/span&gt;);
    request.set_httpVerb(&lt;span style="COLOR: rgb(163,21,21)"&gt;'POST'&lt;/span&gt;);
    request.add_completed(getEmployeeListComplete);
    request.invoke()

    $get(&lt;span style="COLOR: rgb(163,21,21)"&gt;'divList'&lt;/span&gt;).innerHTML = &lt;span style="COLOR: rgb(163,21,21)"&gt;'Loading...'&lt;/span&gt;;
}

&lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt; getEmployeeListComplete(executor, eventArgs)
{
    &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (executor.get_responseAvailable())
    {
        &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; xndEmployees = executor.get_xml().documentElement.getElementsByTagName(&lt;span style="COLOR: rgb(163,21,21)"&gt;'Employee'&lt;/span&gt;);

        &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (xndEmployees)
        {
            &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; output = &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; (xndEmployees.length &amp;gt; 0)
            {
                &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 = 0; i &amp;lt; xndEmployees.length;i++)
                {
                    &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; emp = &lt;span style="COLOR: rgb(0,0,255)"&gt;new&lt;/span&gt; Employee(xndEmployees[i]);
                    output += emp.Name + &lt;span style="COLOR: rgb(163,21,21)"&gt;':'&lt;/span&gt; + emp.Address + &lt;span style="COLOR: rgb(163,21,21)"&gt;':'&lt;/span&gt; + emp.Salary + &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;br/&amp;gt;'
&lt;/span&gt;                }
            }

            $get(&lt;span style="COLOR: rgb(163,21,21)"&gt;'divList'&lt;/span&gt;).innerHTML = output;
        }
    }
}

&lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt; Employee(xndEmployee)
{
    &lt;span style="COLOR: rgb(0,0,255)"&gt;this&lt;/span&gt;.Name = xndEmployee.getElementsByTagName(&lt;span style="COLOR: rgb(163,21,21)"&gt;'Name'&lt;/span&gt;)[0].firstChild.nodeValue;
    &lt;span style="COLOR: rgb(0,0,255)"&gt;this&lt;/span&gt;.Address = xndEmployee.getElementsByTagName(&lt;span style="COLOR: rgb(163,21,21)"&gt;'Address'&lt;/span&gt;)[0].firstChild.nodeValue;
    &lt;span style="COLOR: rgb(0,0,255)"&gt;this&lt;/span&gt;.Salary = parseFloat(xndEmployee.getElementsByTagName(&lt;span style="COLOR: rgb(163,21,21)"&gt;'Salary'&lt;/span&gt;)[0].firstChild.nodeValue);
}&lt;/pre&gt;
&lt;p&gt;The real difference between handling the complex object is that we have to roll our own logic converting to custom object from the xml response like the above. &lt;/p&gt;
&lt;p&gt;In this section we will check how to send a complex object in Asp.net Ajax. Lets create another dummy method which takes an employee object and returns a new id for that employee, like this:&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;int&lt;/span&gt; CreateEmployee(&lt;span style="COLOR: rgb(43,145,175)"&gt;Employee&lt;/span&gt; employee)
{
    &lt;span style="COLOR: rgb(0,128,0)"&gt;//Store it in DB
&lt;/span&gt;    &lt;span style="COLOR: rgb(0,0,255)"&gt;int&lt;/span&gt; id = (&lt;span style="COLOR: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="COLOR: rgb(43,145,175)"&gt;Random&lt;/span&gt;()).Next(1000, 10000);
    &lt;span style="COLOR: rgb(0,0,255)"&gt;return&lt;/span&gt; id;
}&lt;/pre&gt;
&lt;p&gt;Now lets see how to call this method in JavaScript:&lt;/p&gt;
&lt;pre class="code"&gt;&lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt; createEmployee()
{
    &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; requestBody =   &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;?xml version=\"1.0\" encoding=\"utf-8\"?&amp;gt;'&lt;/span&gt; +
                        &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\"&amp;gt;'&lt;/span&gt; +
                          &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;soap:Body&amp;gt;'&lt;/span&gt; +
                            &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;CreateEmployee xmlns=\"http://tempuri.org/\"&amp;gt;'&lt;/span&gt; +
                              &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;employee&amp;gt;'&lt;/span&gt; +
                                &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;Name&amp;gt;'&lt;/span&gt; + &lt;span style="COLOR: rgb(163,21,21)"&gt;'Joe Doe'&lt;/span&gt; + &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;/Name&amp;gt;'&lt;/span&gt; +
                                &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;Address&amp;gt;'&lt;/span&gt; + &lt;span style="COLOR: rgb(163,21,21)"&gt;'Nowhere'&lt;/span&gt; + &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;/Address&amp;gt;'&lt;/span&gt; +
                                &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;Salary&amp;gt;'&lt;/span&gt; + &lt;span style="COLOR: rgb(163,21,21)"&gt;'25000'&lt;/span&gt; + &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;/Salary&amp;gt;'&lt;/span&gt; +
                              &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;/employee&amp;gt;'&lt;/span&gt; +
                            &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;/CreateEmployee&amp;gt;'&lt;/span&gt; +
                          &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;/soap:Body&amp;gt;'&lt;/span&gt; +
                        &lt;span style="COLOR: rgb(163,21,21)"&gt;'&amp;lt;/soap:Envelope&amp;gt;'&lt;/span&gt;;

    &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; request = &lt;span style="COLOR: rgb(0,0,255)"&gt;new&lt;/span&gt; Sys.Net.WebRequest();

    request.set_url(&lt;span style="COLOR: rgb(163,21,21)"&gt;'SimpleWebService.asmx'&lt;/span&gt;);
    request.set_httpVerb(&lt;span style="COLOR: rgb(163,21,21)"&gt;'POST'&lt;/span&gt;);
    request.set_body(requestBody);
    request.get_headers()[&lt;span style="COLOR: rgb(163,21,21)"&gt;'Content-Length'&lt;/span&gt;] = requestBody.length;
    request.get_headers()[&lt;span style="COLOR: rgb(163,21,21)"&gt;'SOAPAction'&lt;/span&gt;] = &lt;span style="COLOR: rgb(163,21,21)"&gt;'http://tempuri.org/CreateEmployee'&lt;/span&gt;;
    request.get_headers()[&lt;span style="COLOR: rgb(163,21,21)"&gt;'Content-Type'&lt;/span&gt;] = &lt;span style="COLOR: rgb(163,21,21)"&gt;'text/xml; charset=utf-8'&lt;/span&gt;;
    request.add_completed(onCreateEmployeeComplete);
    request.invoke()

    $get(&lt;span style="COLOR: rgb(163,21,21)"&gt;'divID'&lt;/span&gt;).innerHTML = &lt;span style="COLOR: rgb(163,21,21)"&gt;'Loading..'&lt;/span&gt;;
}

&lt;span style="COLOR: rgb(0,0,255)"&gt;function&lt;/span&gt; onCreateEmployeeComplete(executor, eventArgs)
{
    &lt;span style="COLOR: rgb(0,0,255)"&gt;if&lt;/span&gt; (executor.get_responseAvailable())
    {
        &lt;span style="COLOR: rgb(0,0,255)"&gt;var&lt;/span&gt; xndResult = executor.get_xml().documentElement.getElementsByTagName(&lt;span style="COLOR: rgb(163,21,21)"&gt;'CreateEmployeeResult'&lt;/span&gt;);

        $get(&lt;span style="COLOR: rgb(163,21,21)"&gt;'divID'&lt;/span&gt;).innerHTML = xndResult[0].firstChild.nodeValue;
    }
}&lt;/pre&gt;
&lt;p&gt;As you can see there are quite bit of difference in this case, first we are constructing a Soap Message, next in the url we are not specifying the &lt;font face="Courier New"&gt;WebMethod&lt;/font&gt; name instead we are specifying the &lt;font face="Courier New"&gt;WebMethod&lt;/font&gt; name by adding a new header &lt;font face="Courier New"&gt;SOAPAction&lt;/font&gt;, we are also adding a new header for the request content type which is &lt;font face="Courier New"&gt;text/xml&lt;/font&gt;.&lt;/p&gt;
&lt;p&gt;In conclusion, I would like to say that main advantage of implementing Asp.net Ajax Library in older VS projects is that we can easily employ our existing knowledge of Asp.net Ajax, no need to learn any new framework and later on If we decide to upgrade our project in VS2005 or maybe VS2008 we can easily do that without breaking a single line of code.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Download&lt;/strong&gt;: &lt;a target="_blank" href="http://www.box.net/shared/gefmkxmjgm"&gt;Complete Code&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/21/Asp.net-Ajax-and-VS2003.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/07/21/Asp.net-Ajax-and-VS2003.aspx" /&gt;&lt;/a&gt;&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114089"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114089" 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/114089.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kazi Manzur Rashid</dc:creator>
            <guid>http://geekswithblogs.net/rashid/archive/2007/07/21/Asp.net-Ajax-and-VS2003.aspx</guid>
            <pubDate>Sat, 21 Jul 2007 18:07:57 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rashid/comments/114089.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rashid/archive/2007/07/21/Asp.net-Ajax-and-VS2003.aspx#feedback</comments>
            <slash:comments>5</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/rashid/comments/commentRss/114089.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rashid/services/trackbacks/114089.aspx</trackback:ping>
        </item>
        <item>
            <title>I am the winner for the Month of June</title>
            <link>http://geekswithblogs.net/rashid/archive/2007/07/19/I-am-the-winner-for-the-Month-of-June.aspx</link>
            <description>&lt;div style="float: left"&gt;&lt;img alt="" src="http://dotnetslackers.com/images/contest/XBox360CoreSystem.jpg" /&gt; &lt;/div&gt; &lt;p&gt;This morning &lt;a href="http://dotnetslackers.com/" target="_blank"&gt;dotnetslackers&lt;/a&gt; announced me as the winner of the XBox article content for the &lt;a href="http://dotnetslackers.com/contest/xbox/#winners" target="_blank"&gt;month of June&lt;/a&gt;. Special thanks to everyone who vote my &lt;a href="http://dotnetslackers.com/articles/ajax/ASPNETAJAXControlDevelopment.aspx" target="_blank"&gt;Asp.net Ajax Control Development&lt;/a&gt; article. Some of my friends asked me why did I choose to write in &lt;a href="http://dotnetslackers.com/" target="_blank"&gt;dotnetslackers&lt;/a&gt; over &lt;a href="http://www.codeproject.com/" target="_blank"&gt;codeproject&lt;/a&gt; when &lt;a href="http://www.codeproject.com/" target="_blank"&gt;codeproject&lt;/a&gt; got &lt;a href="http://www.alexa.com/" target="_blank"&gt;8x more traffic&lt;/a&gt;. The reason behind choosing &lt;a href="http://dotnetslackers.com/" target="_blank"&gt;dotnetslackers&lt;/a&gt;, I think it got much more Asp.net Ajax specialist as a member comparing to &lt;a href="http://www.codeproject.com/" target="_blank"&gt;codeproject&lt;/a&gt; and once it won the &lt;a href="http://dotnetslackers.com/community/blogs/sonukapoor/archive/2006/09/27/DotNetSlackers-wins-the-ASP.NET-Mashup-Atlas-Contest.aspx" target="_blank"&gt;Asp.net Atlas Mashup contest&lt;/a&gt; of &lt;a href="http://www.asp.net/" target="_blank"&gt;Asp.net&lt;/a&gt; and these make me feel that there is no better and friendlier place other than this for my &lt;a href="http://dotnetslackers.com/articles/AJAX/default.aspx" target="_blank"&gt;Asp.net Ajax Articles&lt;/a&gt;. But I have few suggestions for &lt;a href="http://dotnetslackers.com/" target="_blank"&gt;dotnetslackers&lt;/a&gt; to make it more attractive for the developer community:&lt;/p&gt; &lt;ul&gt; &lt;li&gt;Publish Article Instantly, same as &lt;a href="http://www.codeproject.com/" target="_blank"&gt;codeproject&lt;/a&gt; Unedited Reader Contribution.  &lt;/li&gt;&lt;li&gt;A Better Navigation System, Add Editors Pick, Best of this week/month etc.  &lt;/li&gt;&lt;li&gt;Hierarchical Comments section for each article which allows user to post html as well as code. Dump the complete comment in Mail. Send mail when there is a new topic/reply.  &lt;/li&gt;&lt;li&gt;Stop Paid Articles (I am not sure how many good article they found comparing to unpaid) instead find sponsors for article competition, may be for different categories too.  &lt;/li&gt;&lt;li&gt;The Home page is too bulky (385KB as per Firebug). 2x heavy comparing to &lt;a href="http://www.codeproject.com/" target="_blank"&gt;codeproject&lt;/a&gt; and my startpage &lt;a href="http://www.pageflakes.com" target="_blank"&gt;pageflakes&lt;/a&gt;  &lt;/li&gt;&lt;li&gt;A Better Search System (Currently it only scans through news, no article get indexed).  &lt;/li&gt;&lt;li&gt;Allow Article Authors to add meta tag (SEO Optimization)&lt;/li&gt;&lt;/ul&gt; &lt;p&gt;I hope they will take my suggestion seriously and start implementing the above features one by one.&lt;/p&gt;&lt;p&gt;&lt;a href="http://www.pheedo.com/click.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114028"&gt;&lt;img src="http://www.pheedo.com/img.phdo?x=6cda6ad746d942b9a1110d0715a4fa12&amp;u=114028" 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/114028.aspx" width="1" height="1" /&gt;</description>
            <dc:creator>Kazi Manzur Rashid</dc:creator>
            <guid>http://geekswithblogs.net/rashid/archive/2007/07/19/I-am-the-winner-for-the-Month-of-June.aspx</guid>
            <pubDate>Thu, 19 Jul 2007 06:51:54 GMT</pubDate>
            <wfw:comment>http://geekswithblogs.net/rashid/comments/114028.aspx</wfw:comment>
            <comments>http://geekswithblogs.net/rashid/archive/2007/07/19/I-am-the-winner-for-the-Month-of-June.aspx#feedback</comments>
            <slash:comments>2</slash:comments>
            <wfw:commentRss>http://geekswithblogs.net/rashid/comments/commentRss/114028.aspx</wfw:commentRss>
            <trackback:ping>http://geekswithblogs.net/rashid/services/trackbacks/114028.aspx</trackback:ping>
        </item>
    </channel>
</rss>