“Please Wait” text for heavy loading task

Please check following sample code to display “Please wait screen” for heavy loading task.

<head runat=”server”>
<title>Untitled Page</title>
<script language = “javascript”>
function showPleaseWait()
{
document.getElementById(‘PleaseWait’).style.display = ‘none’;
}
</script>
</head>
<body>

<form id=”form1″ runat=”server”>

<div id=”PleaseWait” style=” text-align:right; color:White; vertical-align:top;”>
<table id=”MyTable” bgcolor=”red”>
<tr>
<td>
<b>
<font color=”white”>Please Wait…</font></b></td>
</tr>
</table>
</div>

<asp:Button ID=”Button1″ runat=”server” Text=”Button” onmouseup=”showPleaseWait()” OnClick=”Button1_Click”/>

</form>
</body>

To check this sample add following event in code behind file.

protected void Button1_Click(object sender, EventArgs e)
{
for (double i = 0; i <>
}

Note: here “Please Wait Screen” display logic is on mouse up event, so whenever heavy task started on button click event, “Please Wait…” Message will be displayed.

Posted in Microsoft Technology Tagged with:

Ads