如何使用jQuery将光标更改为“等待”,然后在代码隐藏中恢复为默认值?
代码的前两行可以自行工作(如果我删除其余的代码)。如果我只添加//here I call stored procedure, pass parameters to a class function, which writes excel file and sends it with httpresponse
的其余代码,则不会调用JavaScript函数。
protected void PACR_btnclick(object sender, ImageClickEventArgs e)
{
string myScript = "cursorWait();";
ScriptManager.RegisterStartupScript(this, this.GetType(), "RegisterStartupScript", myScript, true);
//here I call stored procedure, pass parameters to a class function, which writes excel file and sends it with httpresponse
string myScript = "cursorDefault();";
ScriptManager.RegisterStartupScript(this, this.GetType(), "RegisterStartupScript", myScript, true);
}
的javascript:
function cursorWait() {
$("body").css("cursor", "progress");
alert("progress");
}
function cursorDefault() {
alert("default");
$("body").css("cursor", "default");
return false;
}