Showing a waiting progress using javascript

Hi guys,

I come across an idea which going to do the same things like ajax update progress, why this needy because when there are IIIrd party controls like telerik in aspx pages, there is a conflict between rad ajax manager and asp ajax control manager, so I m sharing my idea of using it.

Scenario: I have a button in that page which is going to get huge amount of data and time spend to get the data from database is considerable, then refer the below steps,

  1. Need to have a div (which works like a loading information, and by default its display will be none), and a button which contains a javascript method.
  2. Button client click method

    onClientClick = "ShowProcessDiv('block')"
    // block is to make the div visible for a while
     
  3. Javascript event, find the div and assign the display type,

    function ShowProcessDiv(displayType)
    {
        document.getElementById(
    "divProcess").style.display = displayType;
    }
     

  4. It shows the div, and send the control to server side button click event, there you have to come across your functionality and @ the end of the method (might last line) it should ends with the code which hides the progress division.

    Page.ClientScript.RegisterStartupScript(this.GetType(), "alert", "<script language='javascript'>javascript: ShowProcessDiv('none');</script>");
     

  5. After doing your server side activities, given syntax calls, and automatically it hides the progress div

Ebook Download
View all
Learn
View all