Display "Please Wait" Message!

There are a lot of ways to display a "Please Wait" message on the webform while executing some logic in your code behind. Below is the implementation

First thing you need to do is to create a div HTML server control inside the form tag.

    <div id="divWaitMessage" runat="server" style='WIDTH:100%;HEIGHT:30%'>
    <p><b>Please Wait ...</b></p>
   </div>

Second you need to add a meta tag to refresh the page after a specific time to get the result with a specified parameter in the query string.

 <meta http-equiv="refresh" content="4;url=?id=1"/>

The above code will refresh the page after 4 seconds passing id=1 as a query string parameter.

Third and final thing, you should add the below code at page_load event which will, by default, set the visibility of the div control to true to show the message and after the page refreshes with the specified quey string, it will display a message "Data is retrieved" ( just for testing, in your case you can do whatever functionality you need on the server)

  private void Page_Load(object sender, System.EventArgs e)
  {
   // Hide the div control
   divWaitMessage.Visible = false;

   if(Request.QueryString["id"] == null)
    // Show the "Please Wait" message
    divWaitMessage.Visible = true;
   else
    // Do some processing
    Response.Write("Data is retrieved");
  }

Hope this Helps,

HC

 

 

 

Published 07 July 2007 01:23 AM by haissam

Comments

# almny said on 19 May, 2009 11:02 AM

good idae

usually i used updateprograass

i will try to apply your code

thanks

This site

Search

Go

This Blog

Syndication

Sponsors

  • MaximumASP
  • Breaking News
  • Find a Job
  • Social Bookmarking
    Tidebuy Reviews
    Online Shopping
    asp.net hosting
    UK online local dating