<script runat="server"> private void PleaseWaitButton1_Click(object sender, System.EventArgs e) { // Server-side Click event handler; // simulate something that could take a long time, // like a file upload or time-consuming server processing DateTime dt = DateTime.Now.AddSeconds(5); while (DateTime.Now < dt) { // do nothing; simulate a 5-second pause } // at the end of the loop display a success message // and hide the submit form panelSuccess.Visible = true; PleaseWaitButton1.Visible = false; } </script> <html> <head> <title>Testing PleaseWaitButton</title> </head> <body> <form id="Form1" method="post" runat="server"> <P>Testing the PleaseWaitButton control.</p> <cc1:PleaseWaitButton id="PleaseWaitButton1" runat="server" Text="Click me to start a time-consuming process" PleaseWaitText="Please Wait " PleaseWaitImage="pleaseWait.gif" OnClick="PleaseWaitButton1_Click" /> <asp:Panel id="panelSuccess" runat="server" visible="false"> Thank you for submitting this form. You are truly the coolest user I"ve ever had the pleasure of serving. No, really, I mean it. There have been others, sure, but you are really in a class by yourself. </asp:Panel> </form> </body> </html>