Monday, February 12, 2007

Please Wait Screen for heavy loading task

To display Please Wait Screen

Add Following line in .aspx file

In head Tag

<head runat="server">
    <title>Please Wait Screen</title>
    <script language = "javascript">
    function showPleaseWait()
    {
        document.getElementById('PleaseWait').style.display = 'block';
    }
    </script>
</head>

In Body Tag

<body>
    <form id="form1" runat="server">
        <div class="helptext" id="PleaseWait" style="display: none; 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" OnClick="Button1_Click"  onmouseup="showPleaseWait()"/>    
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.
I have read this interesting code on gridviewguy.com.

7 comments:

Anonymous said...

Wow...its pretty informative for me. thanks for sharing :) DotnetGuts Rocks :)

regards,
samiha esha

Anonymous said...

Wow...its pretty informative for me. thanks for sharing :) DotnetGuts Rocks :)

regards,
samiha esha

Anonymous said...

Thank u guys....really its very clear and informative....ur blog and the authors are rockers.......Awesome stuff guys....Keep it up....[Vallab]

DotNetGuts said...

Thanks Vallab

Anonymous said...

Very, very sharp. Much lighter weight and less complex than some other solutions I've seen. Best of all, it works (in .NET 3.5 anyways)!! Nice job!

workin' class joe

Anonymous said...

I was looking at couple of other approaches as well.I was impressed with this piece of code its light and crisp. I made a small modifications i used the OnClientClick instead of onmouseup

Nice Job Vallab

Regards
Guru Natti

Poongodi said...

Very good. I was looking for this kind of code. Thanks a lot. But this div is very small, i need like which need to lock my page entire until the operation get over. And also i m using master pages(asp.net 2.0). How to achieve it..

Regards
Poongodi

Subscribe Blog via Email

Enter your email address:



Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.
Page copy protected against web site content infringement by Copyscape