Click here to Skip to main content
15,887,477 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
i want to change the cursor to an hourglass while the function runs. Please help me on this.

Thanks
Sherin
Posted

I think you are looking for some thing like this one : busy mouse cursor when page loading in ASP.NET[^]

Regards..
 
Share this answer
 
v2
Comments
sherin.prajin 29-Oct-13 6:08am    
i could not solve the issue with this
Thanks7872 29-Oct-13 6:08am    
That needs effort.
sherin.prajin 29-Oct-13 6:08am    
Please help me if you have some other ideas.
this is your answer


JavaScript
function yourFunc()
{
 document.body.style.cursor = 'wait';
// do somthing !!!
}




I've tested this solution. Works successfully
 
Share this answer
 
v2
Comments
sherin.prajin 29-Oct-13 6:15am    
tried with that. nothing is happening..
seyed mahmud shahrokni 29-Oct-13 6:16am    
It is impossible. It works great. Please try again
sherin.prajin 29-Oct-13 6:37am    
it is not changing into hourglass. i am able to click on that button.
seyed mahmud shahrokni 29-Oct-13 6:44am    
1-if your os is win7 it Will changed to the progress ,,if its xp it Will changed to the hourglass
2- for disabling your button ,, you should disable that button until the process!!!
sherin.prajin 29-Oct-13 10:28am    
yes, my OS is windows7 , is there any other solution for that.
C#
string clickHandler = string.Format("document.body.style.cursor = 'wait'; this.value='Please wait...'; this.disabled = true; {0};",
               this.ClientScript.GetPostBackEventReference(btnSave271Daily, string.Empty));
           btnSave271Daily.Attributes.Add("onclick", clickHandler);


Paste this into PageLoad()

it is working perfectly in IE.

Thank you everyone for your helps.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900