Displaying an hourglass icon in an ASP.NET Web Form
Is there a 'waiting' hourglass method to display an hourglass icon for an ASP.NET Web Form (code behind = VB) like the hourglass used in Visual Basic 6.0?
When you register, you'll begin receiving targeted emails from my team of award-winning writers. Our goal is to provide a unique online resource for developers, architects and development managers tasked with building and maintaining enterprise applications using Visual Basic, C# and the Microsoft .NET platform.
Hannah Smalltree, Editorial Director
First you need to understand that ANYTHING you execute in the code behind is NOT going to reflect on the client browser inmediately (there are exceptions, but are more advanced). The Web Form is not "live" as VB6 ones. Until the HTML code is sent to the client again, the browser will just remain waiting for it. But if you're actually executing the server-side code through JavaScript (I mean through the XmlHttpRequest object), you can put an hourglass in the browser by changing the body style with the following code:
document.body.style.cursor = "wait";
Note, however, that it's useless if you're performing a postback (a form submit) to the server, as the whole page will dissapear from the browser.
Dig Deeper
-
People who read this also read...
This was first published in September 2003