Change cursor in asp.net

I want to change the hourglass cursor in an asp.net application so that my users know that the process is running. I was looking for an answer and was recommended to use javascript as follows.

1) Add this javascript

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

2), then in my code in the page load event:

 btnImport.Attributes.Add("onclick", "javascript: hourglass();"); 

When btnImport is a button, click the button

However, this does not work. But if I add a warning about the hourglass function. it works. Is there any way to make this work without warning.

Thanks in advance.

Bob Avalon

+4
source share
3 answers

How about this:

 btnImport.Attributes.Add("onclick", "hourglass();"); 
+2
source

You tried the code in the codeproject article.

http://www.codeproject.com/KB/scripting/doHourglass.aspx

+2
source

Is this Ajax-Webapp? You can then use UpdateProgress Control to show while the user is waiting for the import to complete.

+2
source

Source: https://habr.com/ru/post/1309587/


All Articles