Hi m miller,
Thank you for the response. I think I've got your definite requirement, you
have to do some data retrieving operation which may take some pieces of
time when the ServerControl button is clicked. Since the operation won't be
finished in a short time, you want to set the client's cursor state to
"wait". I've done some further test on my side and you may try out the
following code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >
<HTML>
<HEAD>
<title>CursorTe st</title>
<meta name="GENERATOR " Content="Micros oft Visual Studio .NET 7.1">
<meta name="CODE_LANG UAGE" Content="C#">
<meta name="vs_defaul tClientScript" content="JavaSc ript">
<meta name="vs_target Schema"
content="http://schemas.microso ft.com/intellisense/ie5">
<script language="javas cript">
function ChangeCursor()
{
//alert(document. body.style.curs or)
if (document.body. style.cursor == "wait")
{
document.body.s tyle.cursor="de fault";
document.Form1. txt2.focus();
}
else
{
document.body.s tyle.cursor="wa it";
document.Form1. txt2.focus();
}
}
</script>
</HEAD>
<body>
<form id="Form1" method="post" runat="server">
<table width="500" border="1" align="center">
<tr>
<td><INPUT id="txt1" type="text" runat="server"> </td>
<td></td>
</tr>
<tr>
<td><FONT face="ËÎÌå"><IN PUT id="txt2" type="text"
runat="server"> </FONT></td>
<td>
<asp:Button id="btnServer" runat="server" Text="Server
Button"></asp:Button></td>
</tr>
</table>
</form>
</body>
</HTML>
---------------------code behind---------------------
private void Page_Load(objec t sender, System.EventArg s e)
{
// Put user code to initialize the page here
btnServer.Attri butes.Add("oncl ick","ChangeCur sor()");
}
private void btnServer_Click (object sender, System.EventArg s e)
{
System.Threadin g.Thread.Sleep( 1000*10);
Response.Write( "<br>Server Button is clicked at:"+
DateTime.Now.To LongTimeString( ));
}
Notice that the "document.body. style.cursor" is empty at first, so we can
check the cursor state like:
if (document.body. style.cursor == "wait")
{.......}else{. ......}
And I use "System.Threadi ng.Thread.Sleep (1000*10);" in the Serverside
button's click event to simulate the long time Data retrieving operation
you mentioned.
Hope it is helpful. If you have any question on it ,please feel free to
let me know.
Steven Cheng
Microsoft Online Support
Get Secure!
www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)