<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-623348949309491130</id><updated>2011-11-27T15:45:00.102-08:00</updated><category term='Understanding Globalization in.Net'/><category term='Block Controls'/><category term='Implementing Icallbackeventhandler in .net'/><category term='Microsoft'/><category term='Processing page'/><category term='AJAX with .Net 2.0'/><category term='Ajax in .Net'/><category term='.Net'/><category term='resource files in .net'/><category term='Lock Page'/><category term='Callback event'/><category term='Ajax Callback'/><category term='Ajax'/><category term='setting UICulture'/><category term='Loading Wait'/><category term='Callback in .Net'/><category term='ICallbackEventHandler in .Net'/><category term='ICallbackEventHandler'/><category term='Globalization in .Net'/><category term='Webpage'/><category term='Block WebPage'/><category term='Freeze Webpage'/><category term='Web Application'/><category term='Understanding Globalization and Localization in .NET'/><category term='Sneaky Postback'/><category term='Globalization in webapplication'/><title type='text'>Dhaval Upadhyaya</title><subtitle type='html'>Articles on Microsoft Technology</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://dhavalupadhyaya.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/623348949309491130/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://dhavalupadhyaya.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Dhaval Upadhyaya</name><uri>http://www.blogger.com/profile/13567953111420131976</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-623348949309491130.post-1618220698040970599</id><published>2008-06-22T05:46:00.000-07:00</published><updated>2008-06-22T06:07:03.293-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='setting UICulture'/><category scheme='http://www.blogger.com/atom/ns#' term='resource files in .net'/><category scheme='http://www.blogger.com/atom/ns#' term='Understanding Globalization and Localization in .NET'/><category scheme='http://www.blogger.com/atom/ns#' term='Understanding Globalization in.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Globalization in webapplication'/><category scheme='http://www.blogger.com/atom/ns#' term='Globalization in .Net'/><title type='text'>Understanding Globalization and Localization in .NET</title><content type='html'>&lt;strong&gt;Understanding Globalization and Localization in .NET&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Now days as the audience for web applications has bursted from computers to pda's, cell phones and many other gadgets, Globalization has become must for web application. Globalization allows your web application to be useful for different people in different parts of the world who speaks different languages.&lt;br /&gt;&lt;br /&gt;Thanks to Microsoft .Net Globalization feature.&lt;br /&gt;Using this feature one can easily build a web application available to dispersed audience throughout the world.&lt;br /&gt;&lt;br /&gt;&lt;u&gt;In this article&lt;/u&gt; I will walkthrough the steps that are essential for creating a multi cultured application. This example will include the use of Global and Local resource files that are heart for multi cultured web application.&lt;br /&gt;&lt;br /&gt;ASP.Net supports two types of resources&lt;br /&gt;Local Resource and Global Resource.&lt;br /&gt;Both types of Resources are xml based resource files that can contain text translated into particular language&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Local Resources&lt;/strong&gt;:&lt;br /&gt;Local resource is specific to particular webpage. All the resource files related to particular webpage must be placed in a special .Net folder named App_LocalResources. This folder must be in the same folder of the webpage that you want to localize. So App_LocalResources can be subfolder for any folder of your website.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Global Resources&lt;/strong&gt;:&lt;br /&gt;They are the resource files for the entire web application. They are not specific to any page. They can be accessed from the entire web application. Global resource files must be located in a special .Net folder named App_GlobalResources. App_GlobalResources must be at the root of the web application.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Steps to create local Resource file.&lt;br /&gt;&lt;/strong&gt;1) Switch to design view of the webpage for which you want to create the resource file.&lt;br /&gt;2) Go to Tools menu and click Generate Local Resource.&lt;br /&gt;3) As the result of step 2 .Net generates the .resx file.&lt;br /&gt;Naming conventions that Resource files follow is as explained below:&lt;br /&gt;&lt;pagename&gt;&amp;lt;PageName&amp;gt;.aspx.&amp;lt;language&amp;gt;.resx&lt;br /&gt;Example&lt;br /&gt;myWebPage.aspx.resx: This is the default resource file of your page. If no culture matches than this resource file is used.&lt;br /&gt;myWebPage.aspx.es.resx: For Neutral Spanish culture it may look like this.&lt;br /&gt;myWebPage.aspx.es-MX.resx: For Specific Spanish Mexican culture it may look like this.&lt;br /&gt;What do you mean by neutral and specific cultures? I leave this small exercise to readers.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Steps to create global Resource file.&lt;/strong&gt;&lt;br /&gt;1) Their are no specific utilities in .Net to generate Global resource files automatically. But you can create App_GlobalResources folder at root level and add a resource file manually Or you may copy the local resource file and change it at your will.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Ways in which you can Globalize or localize your application.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Implicit Localization&lt;/u&gt;&lt;br /&gt;&lt;?xml:namespace prefix = asp /&gt;&lt;asp:label id="lblLoadLocalResource" resourcekey="lblLoadLocalResourceResource1" text="Local Resource" runat="server"&gt;&lt;/asp:label&gt;&amp;lt;asp:Label ID="lblLoadLocalResource" runat="server" Text="Local Resource" meta:resourcekey="lblLoadLocalResourceResource1"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Implicit Globalization&lt;/u&gt;&lt;br /&gt;&lt;asp:label id="lblLoadGlobalResource" text="" runat="server"&gt;&amp;lt;asp:Label ID="lblLoadGlobalResource" runat="server" Text="&amp;lt;%$ Resources:Resource, commonHeader %&amp;gt;" ToolTip="&amp;lt;%$ Resources:Resource, commonHeader %&amp;gt;"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;/asp:label&gt;&lt;br /&gt;&lt;asp:label text="" runat="server"&gt;&lt;/asp:label&gt;&lt;br /&gt;&lt;u&gt;Programmatic Localization&lt;/u&gt;&lt;br /&gt;lblLoadLocalResource.Text = GetLocalResourceObject("lblLoadLocalResourceResource1.Text").ToString();&lt;br /&gt;lblLoadLocalResource.ToolTip = GetLocalResourceObject "lblLoadLocalResourceResource1.ToolTip").ToString();&lt;br /&gt;&lt;br /&gt;&lt;u&gt;Programmatic Globalization&lt;br /&gt;&lt;/u&gt;lblLoadGlobalResource.Text = GetGlobalResourceObject("Resource", "commonHeader").ToString();&lt;br /&gt;lblLoadGlobalResource.ToolTip = GetGlobalResourceObject("Resource", "commonHeader").ToString();&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How to change the UI Culture?&lt;/strong&gt;&lt;br /&gt;Steps to check and configure the UI Culture of your webpage&lt;br /&gt;1) To change it programmatically you need to override the InitializeCulture() of your web page.&lt;br /&gt;protected override void InitializeCulture()&lt;br /&gt;{&lt;br /&gt;UICulture = "en";&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;2) To change it implicitly from .aspx page Set&lt;br /&gt;&amp;lt;%@ Page Language="C#" UICulture="en" %&amp;gt;&lt;br /&gt;&lt;br /&gt;3)To change it globally from web.config file&lt;br /&gt;&lt;system.web&gt;&amp;lt;system.web&amp;gt; &amp;lt;globalization uiCulture="es"/&amp;gt; &amp;lt;/system.web&amp;gt;&lt;br /&gt;&lt;globalization uiculture="es"&gt;&lt;br /&gt;&lt;/SYSTEM.WEB&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you set UICulture="auto" then .Net runtime will automatically detect the requesting browsers preferred language setting and will compile the related resource file for that culture. In this case you do not have to write a single piece of code for setting UICulture.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How to check this?&lt;br /&gt;&lt;/strong&gt;1) Open IE and go to Tools &gt; internet Options&lt;br /&gt;2) Click Languages tab.&lt;br /&gt;3) This will open language Preference dialog box window.&lt;br /&gt;4) Add the language by clicking the add button. Make sure to add the language for which you have configured the resource file of your web page.&lt;br /&gt;5) Select the language that you have added and using Move Up button, bring it to the first topmost position in the language list.&lt;br /&gt;6) Press Ok and again Ok to return.&lt;br /&gt;&lt;br /&gt;Open your webpage in the browser and enjoy the taste of globalized web application.&lt;br /&gt;I believe that few lines of code can speak thousand words and so I have prepared a small demo that includes both Globalization and Localization.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff0000;"&gt;To download the entire source code &lt;/span&gt;&lt;a title="Globalization in .Net Code Sample by Dhaval Upadhyaya" href="http://upadhyayadhaval.googlepages.com/Globalization.zip" target="_blank" mce_href="http://upadhyayadhaval.googlepages.com/Globalization.zip"&gt;&lt;span style="color:#ff0000;"&gt;Click Here&lt;/span&gt;&lt;/a&gt;&lt;span style="color:#ff0000;"&gt;.&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Note:&lt;/strong&gt; Globalizing the web application entirely, requires lots of other things like changing the Culture, formatting dates and currency and lot more. I will try to incorporate all this stuff in my next article.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/623348949309491130-1618220698040970599?l=dhavalupadhyaya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhavalupadhyaya.blogspot.com/feeds/1618220698040970599/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=623348949309491130&amp;postID=1618220698040970599' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/623348949309491130/posts/default/1618220698040970599'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/623348949309491130/posts/default/1618220698040970599'/><link rel='alternate' type='text/html' href='http://dhavalupadhyaya.blogspot.com/2008/06/understanding-globalization-and.html' title='Understanding Globalization and Localization in .NET'/><author><name>Dhaval Upadhyaya</name><uri>http://www.blogger.com/profile/13567953111420131976</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-623348949309491130.post-2775015587290442177</id><published>2008-06-14T04:23:00.000-07:00</published><updated>2008-06-22T05:42:01.235-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Ajax Callback'/><category scheme='http://www.blogger.com/atom/ns#' term='Callback in .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Implementing Icallbackeventhandler in .net'/><category scheme='http://www.blogger.com/atom/ns#' term='ICallbackEventHandler in .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='ICallbackEventHandler'/><category scheme='http://www.blogger.com/atom/ns#' term='Callback event'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax in .Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Sneaky Postback'/><title type='text'>Implementing ICallbackEventHandler in .Net 2.0</title><content type='html'>&lt;strong&gt;Implementing ICallbackEventHandler in .Net 2.0 Custom Control.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;In this article I depict the use of ICallbackEventHandler with an example that shows random text generated from the server side code. For this purpose I have created a custom control named Show Tip.&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How Show Tip control works.&lt;/strong&gt;&lt;br /&gt;Show Tip control renders the HTML button. Clicking this button initiates AJAX call to the server. The server processes the AJAX call raised from the client browser and returns the result. Lastly a JavaScript registered on the client browser displays the result in a DIV tag. The main motive behind this is to avoid the full page post backs. Show tip Button directly communicates with the server using "Sneaky Post back".&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;How callbacks also known as "Sneaky Post back" actually work.&lt;/strong&gt;&lt;br /&gt;The main magic lies in the ICallbackEventHandler interface.By implementing this interface and some lit bit of code one can easily trap the events raised from Client Browser, on the server and can respond to such events.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Steps to use ICallbackEventHandler .&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 1)&lt;/strong&gt;Render the JavaScript on Client Browser that will initiate the AJAX call.&lt;br /&gt;To create the JavaScript that initiates the AJAX call use Page.ClientScript.GetCallbackEventReference() method.&lt;br /&gt;&lt;br /&gt;This method returns a string&lt;br /&gt;WebForm_DoCallback('ShowTip1',null,showResult,null,showError,false).&lt;br /&gt;&lt;br /&gt;This is the JavaScript function that is used to callback to the server.&lt;br /&gt;&lt;br /&gt;The parameters used for GetCallbackEventReference() method are listed below.&lt;br /&gt;1) control - the control that initiates the AJAX call.&lt;br /&gt;&lt;br /&gt;2) argument - the argument that is send to the server. In this example it is null as we are not passing any value back to server. But you can pass any value Example if you want to display price for the selected item from combo.&lt;br /&gt;&lt;br /&gt;3) clientCallback - the name of the JavaScript function that executes after the result is returned from the server.&lt;br /&gt;&lt;br /&gt;4) context - the argument that is passed back to the clientCallback() and clientErrorCallback() methods after the AJAX call completes . In this example it is null as we are not passing any value to client browser.&lt;br /&gt;&lt;br /&gt;5) clientErrorCallback - the name of the JavaScript function that executes on client browser if an error on the server occues during AJAX callback.&lt;br /&gt;&lt;br /&gt;6) useAsync - pass false to perform the AJAX call asynchronously.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 2)&lt;/strong&gt;Implement the methods of ICallbackEventHandler to handle the AJAX call.&lt;br /&gt;ICallbackEventHandler has two methods that need to be implemented on the server side.&lt;br /&gt;1) RaiseCallbackEvent - This method is called first on server by AJAX call from the client.&lt;br /&gt;2) GetCallbackResult - This method Returns the result of the AJAX call to the client.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Step 3)&lt;/strong&gt;Render the JavaScript on Client Browser that manipulates the result received from the server. To render the JavaScript on Client Browser use Page.ClientScript.RegisterClientScriptInclude("ShowTip", Page.ResolveClientUrl("~/ClientScripts/ShowTip.js")) method.&lt;br /&gt;The parameters used for RegisterClientScriptInclude() method are listed below.&lt;br /&gt;1) key - any string that represents the script instance name.&lt;br /&gt;2) url - the path of the JavaScript file to register on the client browser that is called when results are returned from the server.&lt;br /&gt;&lt;br /&gt;&lt;span style="color:#ff6600;"&gt;To download the entire example &lt;/span&gt;&lt;a href="http://upadhyayadhaval.googlepages.com/ShowTip.zip"&gt;&lt;span style="color:#ff6600;"&gt;Click Here&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;ASP .Net 2.0 bundles some controls like Grid View, Tree View and Details View that use AJAX callbacks to perform some special tasks like&lt;br /&gt;Grid View uses callback to perform AJAX based paging and sorting.&lt;br /&gt;Tree View uses callback to perform AJAX based expansion of nodes.&lt;br /&gt;Details View uses callback to perform AJAX based paging.&lt;br /&gt;You will have to enable some property to do so. I leave this small exercise to the readers.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/623348949309491130-2775015587290442177?l=dhavalupadhyaya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhavalupadhyaya.blogspot.com/feeds/2775015587290442177/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=623348949309491130&amp;postID=2775015587290442177' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/623348949309491130/posts/default/2775015587290442177'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/623348949309491130/posts/default/2775015587290442177'/><link rel='alternate' type='text/html' href='http://dhavalupadhyaya.blogspot.com/2008/06/implementing-icallbackeventhandler-in.html' title='Implementing ICallbackEventHandler in .Net 2.0'/><author><name>Dhaval Upadhyaya</name><uri>http://www.blogger.com/profile/13567953111420131976</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-623348949309491130.post-8103479710859404529</id><published>2008-06-04T09:10:00.000-07:00</published><updated>2008-06-04T09:32:18.347-07:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Lock Page'/><category scheme='http://www.blogger.com/atom/ns#' term='Ajax'/><category scheme='http://www.blogger.com/atom/ns#' term='Webpage'/><category scheme='http://www.blogger.com/atom/ns#' term='Loading Wait'/><category scheme='http://www.blogger.com/atom/ns#' term='AJAX with .Net 2.0'/><category scheme='http://www.blogger.com/atom/ns#' term='Freeze Webpage'/><category scheme='http://www.blogger.com/atom/ns#' term='Block Controls'/><category scheme='http://www.blogger.com/atom/ns#' term='Web Application'/><category scheme='http://www.blogger.com/atom/ns#' term='Processing page'/><category scheme='http://www.blogger.com/atom/ns#' term='Microsoft'/><category scheme='http://www.blogger.com/atom/ns#' term='.Net'/><category scheme='http://www.blogger.com/atom/ns#' term='Block WebPage'/><title type='text'>How to Freeze Webpage while it is being processed in .Net 2.0 using AJAX?</title><content type='html'>&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;How to Freeze Webpage while it is being processed in .Net 2.0 using AJAX?&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Blocking a webpage seems to be difficult task while the data on the page is being posted back to the server or it is being refreshed. It becomes tricky to track the postback and reloading of the page. Though this can be achieved by using Response.Flush() method but it requires some extra effort.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;But thanks to AJAX Update Progress Panel.&lt;br /&gt;&lt;br /&gt;Using Update Progress Panel its just the mater of putting it on the page. The real magic lies in this panel and the DIV tag inside it. The panel takes care of the events required during the page updation and the DIV blocks the page till the panel is active. The magic that actually blocks the page lies in the DIV tag. I leave this to readers to find the crux of the magic.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Following is the Code you can use to block the Webpage.&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;ajax:UpdateProgress ID="UpdateProgress1" runat="server"&amp;gt;&amp;lt;ProgressTemplate&amp;gt;&amp;lt;div style="top: 0px; height: 1000px; background-color: White; opacity: 0.75; filter: alpha(opacity=75);vertical-align: middle; left: 0px; z-index: 999999; width: 1000px; position: absolute;text-align: center;"&amp;gt;&amp;lt;/div&amp;gt;&amp;lt;/ProgressTemplate&amp;gt;&amp;lt;/ajax:UpdateProgress&amp;gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;I have used simple DIV tag but it can be enhanced using an animated gif file or other custom JavaScript for showing loading image or processing time.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Note:&lt;/strong&gt;If you are using this code on the local server than AJAX might be so fast that the effect of this may not be visible.So try to use this code where the server requires some time to process the request OR use Thread.Sleep(5000) on your page. &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-family:verdana;font-size:85%;"&gt;&lt;strong&gt;Sample Code Using Code Behind Modal:&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="WaitForRequest.aspx.cs" Inherits="WaitForRequest" %&amp;gt;&lt;br /&gt;&amp;lt;%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"&lt;br /&gt;Namespace="System.Web.UI" TagPrefix="ajax" %&amp;gt;&lt;br /&gt;&amp;lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&amp;gt;&lt;br /&gt;&amp;lt;html xmlns="http://www.w3.org/1999/xhtml"&amp;gt;&lt;br /&gt;&amp;lt;head runat="server"&amp;gt;&lt;br /&gt;&amp;lt;title&amp;gt;Wait For Request&amp;lt;/title&amp;gt;&lt;br /&gt;&amp;lt;/head&amp;gt;&lt;br /&gt;&amp;lt;body&amp;gt;&lt;br /&gt;&amp;lt;form id="form1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;div&amp;gt;&lt;br /&gt;&amp;lt;ajax:ScriptManager ID="ScriptManager1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;/ajax:ScriptManager&amp;gt;&lt;br /&gt;&amp;lt;ajax:UpdatePanel ID="UpdatePanel1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;ContentTemplate&amp;gt;&lt;br /&gt;&amp;lt;asp:Button ID="btnGetDate" runat="server" Text="Get Date" OnClick="btnGetDate_Click"&amp;gt;&lt;br /&gt;&amp;lt;/asp:Button&amp;gt;&amp;lt;br /&amp;gt;&lt;br /&gt;&amp;lt;asp:Label ID="lblTime" runat="server"&amp;gt;&amp;lt;/asp:Label&amp;gt;&lt;br /&gt;&amp;lt;/ContentTemplate&amp;gt;&lt;br /&gt;&amp;lt;/ajax:UpdatePanel&amp;gt;&lt;br /&gt;&amp;lt;ajax:UpdateProgress ID="UpdateProgress1" runat="server"&amp;gt;&lt;br /&gt;&amp;lt;ProgressTemplate&amp;gt;&lt;br /&gt;&amp;lt;div style="top: 0px; height: 1000px; background-color: White; opacity: 0.75; filter: alpha(opacity=75);&lt;br /&gt;vertical-align: middle; left: 0px; z-index: 999999; width: 1000px; position: absolute;&lt;br /&gt;text-align: center;"&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/ProgressTemplate&amp;gt;&lt;br /&gt;&amp;lt;/ajax:UpdateProgress&amp;gt;&lt;br /&gt;&amp;lt;/div&amp;gt;&lt;br /&gt;&amp;lt;/form&amp;gt;&lt;br /&gt;&amp;lt;/body&amp;gt;&lt;br /&gt;&amp;lt;/html&amp;gt;&lt;br /&gt;&lt;br /&gt;using System;using System.Threading;using System.Data;using System.Configuration;using System.Collections;using System.Web;using System.Web.Security;using System.Web.UI;using System.Web.UI.WebControls;using System.Web.UI.WebControls.WebParts;using System.Web.UI.HtmlControls;public partial class WaitForRequest : System.Web.UI.Page{ protected void Page_Load(object sender, EventArgs e) { } protected void btnGetDate_Click(object sender, EventArgs e) { Thread.Sleep(5000); lblTime.Text = DateTime.Now.ToString(); }} &lt;/span&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/623348949309491130-8103479710859404529?l=dhavalupadhyaya.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://dhavalupadhyaya.blogspot.com/feeds/8103479710859404529/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://www.blogger.com/comment.g?blogID=623348949309491130&amp;postID=8103479710859404529' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/623348949309491130/posts/default/8103479710859404529'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/623348949309491130/posts/default/8103479710859404529'/><link rel='alternate' type='text/html' href='http://dhavalupadhyaya.blogspot.com/2008/06/how-to-freeze-webpage-while-it-is-being_04.html' title='How to Freeze Webpage while it is being processed in .Net 2.0 using AJAX?'/><author><name>Dhaval Upadhyaya</name><uri>http://www.blogger.com/profile/13567953111420131976</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
