1

如何使用 jQuery 将光标更改为“等待”,然后在代码隐藏中恢复为默认值?

代码的前 2 行本身可以正常工作(如果我删除其余代码)。如果我只添加其余代码,//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;
 }
4

0 回答 0