I tried this and it worked only when I moved the cursor from the button in the nearby area. If we do not move the cursor from the button or go away from the area where button is, it did not work. Could someone please help?
Great post! I am trying to do this with the TextChanged event of a textbox. THe user enters a check number into the field and a method runs to check the db for a duplicate check number. It thern pops up a grey box displaying key information about the exiting
check that already had that check number (if one is found). While this validation is going on, I would like to show a wait cursor. I tried this:
Sub SubmitBtn_Click(ByVal sender
As
Object,
ByVal e
As ImageClickEventArgs)
'Change Cursor to 'Wait' Cursor here
'Do some processing here
'Change Cursor to 'Default' here
End
Sub
With the example provided, I can change the cursor when the button is clicked, but how do I change it back to default after the processing is done?
I am trying to do the same in c#. I have been looking for a solution for the past two days but no success yet.
I like to show the mouse as hourglass when the user click on the "search" button until the data is loaded in a datagrid. Then change the cursor back to default.
So I tried the following in the page_load() event,
the mouse changes to hourglass when i click the button and then once the datagrid is loaded it is changing it back to pointer but when i move the cursor it is again changing back to hourglass.
I'm using an Ifram in page X , I want to change the cursor to 'wait' while the Ifram loads page Y, But the problem is ! I can't restore the cursor to 'default' once page Y inside the Ifram is fully loaded !
I know the javascript code but I dont know where to put it ! In Page X ! Page Y !! Where exactly !?
Andy C
Member
497 Points
108 Posts
Re: How to change the Mouse cursor
May 04, 2005 11:04 AM|LINK
pdm2
Member
59 Points
11 Posts
Re: How to change the Mouse cursor
Jul 23, 2005 02:23 AM|LINK
coolgemini
Member
5 Points
1 Post
Re: How to change the Mouse cursor
Jan 27, 2006 08:57 PM|LINK
hi,
I have a link to generate reports. So during the process it should show the hourglass(wait) then back to arrow.
how did u bring the cursor back to normal arrow?
SomeNewKid
All-Star
45894 Points
8027 Posts
Re: How to change the Mouse cursor
Jan 28, 2006 01:10 AM|LINK
document.body.style.cursor='default';
Rupen Shah
Member
9 Points
25 Posts
Re: How to change the Mouse cursor
Sep 19, 2007 01:59 PM|LINK
I tried this and it worked only when I moved the cursor from the button in the nearby area. If we do not move the cursor from the button or go away from the area where button is, it did not work. Could someone please help?
jctyce
Member
2 Points
1 Post
Re: How to change the Mouse cursor
Jan 25, 2008 12:49 PM|LINK
Great post! I am trying to do this with the TextChanged event of a textbox. THe user enters a check number into the field and a method runs to check the db for a duplicate check number. It thern pops up a grey box displaying key information about the exiting check that already had that check number (if one is found). While this validation is going on, I would like to show a wait cursor. I tried this:
<Code>
this.textBoxCheckNum.Attributes.Add("ontextchanged", "document.body.style.cursor = 'wait';"); //in PageLoad
//In the event that fires I do this
public void txtBox_SetDirty(object sender, EventArgs e)
{
if (((TextBox)sender).ID == textBoxCheckNum.ID)
{
System.Threading.Thread.Sleep(3000);
if(CheckNumberIsDuplicate())
if (Session_Data.CheckData.KeepDuplicateCheckNumber)
Session_Data.CheckData.RecordHasChanges = true;
else
{
Session_Data.CheckData.RecordHasChanges = false;
textBoxCheckNum.Text = string.Empty;
}
}
else
{
if (Session_Data.IsLoading.Type != Session_Data.LoadType.Check && Session_Data.IsLoading.Type != Session_Data.LoadType.ReportItem)
Session_Data.CheckData.RecordHasChanges = true;
}
}
//Then in my script is set it back to default
function SeeDupCheck(CheckNum)
{
var URL = 'DuplicateCheck.aspx?CheckNum='+CheckNum;
document.body.style.cursor='default';
return GB_showCenter('Duplicate Check Number',URL,500,500);
}
</Code>
I do not get a wait cursor. What am I doing wrong?
Thanks,
John
microsoft_ad...
Member
2 Points
4 Posts
Re: How to change the Mouse cursor
Feb 25, 2009 09:57 PM|LINK
I want to do something like this:
Sub SubmitBtn_Click(ByVal sender As Object, ByVal e As ImageClickEventArgs)'Change Cursor to 'Wait' Cursor here
'Do some processing here
'Change Cursor to 'Default' here
End Sub
With the example provided, I can change the cursor when the button is clicked, but how do I change it back to default after the processing is done?
Thanks,
Paras Wadehra
ASP.NET button click Paras Wadehra Mouse cursor
Paras Wadehra
RPadhmanaban
Member
2 Points
6 Posts
Re: How to change the Mouse cursor
Feb 02, 2010 11:32 PM|LINK
Any one found the solution for this problem?
I am trying to do the same in c#. I have been looking for a solution for the past two days but no success yet.
I like to show the mouse as hourglass when the user click on the "search" button until the data is loaded in a datagrid. Then change the cursor back to default.
So I tried the following in the page_load() event,
btnFind.Attributes.Add("onclick", "document.body.style.cursor = 'wait';");
dgResults.Attributes.Add("OnDataBinding", "document.body.style.cursor = default;");
It works fine,
the mouse changes to hourglass when i click the button and then once the datagrid is loaded it is changing it back to pointer but when i move the cursor it is again changing back to hourglass.
it looks like it is working but not..
If any one got the solution please post it on.
I highly appreciate your time
Thanks
Renu
Scofield007
Member
12 Points
18 Posts
Re: How to change the Mouse cursor
Jun 14, 2010 08:04 AM|LINK
Hello guys,
I'm using an Ifram in page X , I want to change the cursor to 'wait' while the Ifram loads page Y, But the problem is ! I can't restore the cursor to 'default' once page Y inside the Ifram is fully loaded !
I know the javascript code but I dont know where to put it ! In Page X ! Page Y !! Where exactly !?
Your help is highly appreciated.
zoetosis
Member
265 Points
119 Posts
Re: How to change the Mouse cursor
Jun 02, 2011 11:05 AM|LINK
document.body.style.cursor='wait';
... some other javascript code here that does the real work
document.body.style.cursor='default';
I have a function (outlined above) that works correctly except for the statements that change the mouse cursor.
The page itself is within a masterpage, will this make a difference?
javascript asp.net masterpage cursor