Hi, To show “Please wait” text on button click, you can use AJAX UpdateProgress control. The code is given below.
<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>
<asp:UpdateProgress ID="UpdateProgress1" DisplayAfter="10" runat="server" AssociatedUpdatePanelID="upTest">
<ProgressTemplate>
<div class="divWaiting">
<asp:Label ID="lblWait" CssClass="waitText" runat="server" Text=" Please wait..."></asp:Label></div>
</ProgressTemplate>
</asp:UpdateProgress>
Place the asp.net button in update panel and set the attributes of update panel as given below.
<asp:UpdatePanel ID="upTest" ChildrenAsTriggers="true" UpdateMode="Conditional" runat="server">
<ContentTemplate>
<asp:Button ID="btnSubmit" Text="Submit" OnClick="btnSubmit_Click" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
To add on to this, you can add the below css in <head></head> of your page for making the background inactive while “Please wait” is shown.
<head><style type="text/css">
.divWaiting
{
position: absolute; background-color: #FAFAFA; z-index: 2147483647 !important; opacity: 0.8;
overflow: hidden; text-align: center; top: 0; left: 0; height: 100%; width: 100%; }
.waitText
{
position: relative; top: 45%; color: Black; font-size: 26px;
font-weight: bold; background-color: #FAFAFA; }
</style></head>
To download Ajax Control Toolkit and know how to add the Ajax Control Toolkit to the Visual Studio Toolbox, please visit
http://www.asp.net/ajaxlibrary/act.ashx