By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
425,971 Members | 907 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 425,971 IT Pros & Developers. It's quick & easy.

Changing the cursor to an hourglas

P: n/a
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
Jul 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
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/de...thor/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.

Jul 21 '05 #2

P: n/a
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/de...thor/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.

Jul 21 '05 #3

P: n/a
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


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #4

P: n/a
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


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.