Changing the cursor to an hourglas

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am building an ASP.Net application that occasionaly "stalls" while running a server side process like a large database update. During this tine the user does not get any feedback as to what is going on, an is likely to try clicking things multiple times which could result in an unwanted outcome.

Is there any way to change the mouse pointer to an hourglass or other such icon to signal the user that the request is being processed?

Thanks

Michael Albanese
 
Hello Michael,

Thanks for your post. As I understand, you want to change the cursor in a
Web Form. Please correct me if there is any misunderstanding.

You can set the cursor to hourglas in the client script by calling the
following line:
document.body.style.cursor="wait";

As in this case, I suggest you to attach javascript click event to the
button (which will perform time-consuming database manipulateion) in the
page_onload like below:
Me.btnDBOperation.Attributes.Add("onclick", "waitcursor()")

And then change the cursor in the corresponding javascript function:

function waitcursor()
{
document.body.style.cursor="wait";
}

Please refer to the following MSDN article for detailed information:

cursor Attribute | cursor Property
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/ref
erence/properties/cursor.asp

Hope this helps.

Regards,

HuangTM
Microsoft Online Partner Support
MCSE/MCSD

Get Secure! -- www.microsoft.com/security
This posting is provided "as is" with no warranties and confers no rights.
 
Yes, I want to change the cursor in the web form and the client side
script you sent make a lot of sense.

Thanks!

Michael
 
Back
Top