In this article we will see how to make a simple wait page. Consider a situation in which the client is performing some time consuming operation and is unaware if the operation has been completed or not. It is always a good idea to keep the client/user informed that the task is in process and he should be patient and wait. This short article will take an approach to create the simplistic wait page.

Introduction:

In this article we will see how to make a simple wait page. Consider a situation in which the client is performing some time consuming operation and is unaware if the operation has been completed or not. It is always a good idea to keep the client/user informed that the task is in process and he should be patient and wait. This short article will take an approach to create the simplistic wait page.

Creating the wait page:

Before starting I would like to thank NicButler for providing the complete code. Okay here are few things you need to do. First task is to attach the onmouseup event to the asp.net button control. The button click event can perform any any time consuming task.

<asp:Button id="Btn_Upload" onmouseup="showPleaseWait()" runat="server" Text="Upload"></asp:Button></P>

Now, let's see the showPleaseWait method.

<script language = "javascript">

function showPleaseWait()
{
document.getElementById('PleaseWait').style.display = 'block';
}


</script>

And finally the definition of the PleaseWait element which is of <DIV> type.

<DIV class="helptext" id="PleaseWait" style="DISPLAY: none; TEXT-ALIGN: center">
<table id="MyTable" bgcolor="pink">
<tr>
<td><h2>Please Wait..</h2></td>
</tr>
</table>
</DIV>

And here is the complete code:

<%@ Page language="c#" Codebehind="UploadFile.aspx.cs" AutoEventWireup="false" Inherits="CasaWebApps.UploadFile" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>UploadFile</title>
<meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">
<meta name="CODE_LANGUAGE" Content="C#">
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<P>Please select a file to upload:
</P>
<P>Select a file: <INPUT id="FileUpload" type="file" name="File1" runat="server"></P>
<P>
<asp:Button id="Btn_Upload" onmouseup="showPleaseWait()" runat="server" Text="Upload"></asp:Button></P>
<P>
<asp:Label id="lblMsg" runat="server" Font-Names="Georgia"></asp:Label></P>
<P>&nbsp;</P>
</form>
<DIV class="helptext" id="PleaseWait" style="DISPLAY: none; TEXT-ALIGN: center">
<table id="MyTable" bgcolor="pink">
<tr>
<td><h2>Please Wait..</h2></td>
</tr>
</table>
</DIV>

</body>
</HTML>

<script language = "javascript">

function showPleaseWait()
{
document.getElementById('PleaseWait').style.display = 'block';
}



</script>
 

I hope you liked this article, happy coding!

If you are one of those thousands of people who are benefited from GridViewGuy articles and want to show your love then you will be interested in giving a donation.

Make a Donation

Once, again thank you very much and remember its because of you FINE people that this website is up and running.

 

Export Button is a custom control that let's you export your DataGrid or TextBox data to several different formats. The control is extremely easy to use and also exposes design time features. In this article I will discuss some of the features of the Export Button and how it benefits the developer.

BUY IT NOW