“参数计数不匹配”发生在 asp.net 中按钮的单击事件上

"Parameter count mismatch" is occurring on the click event of a button in asp.net

本文关键字:按钮 net 单击 事件 asp 参数 不匹配      更新时间:2023-09-26

当我点击按钮时

出错

Microsoft JScript 运行时错误:系统参数计数异常:参数计数不匹配。

Function.emptyFunction = Function.emptyMethod = function Function$emptyMethod() {
/// <summary locid="M:J#Function.emptyMethod" />
if (arguments.length !== 0) throw Error.parameterCount();
}//Error is occuring here.

是的,我在此页面中使用了JavaScript确认消息,该消息包含在母版页,更新面板和ScriptManager中,并且在客户端单击按钮时,单击此按钮后出现错误,下面是我的代码

function Confirm() {
if(document.getElementById('<%= btnSave.ClientID %>').value=="UPDATE")
{
    if(document.getElementById('<%= userStatus.ClientID %>').value=="INACTIVE")
        {
            if (confirm("do you want to make the user INACTIVE? 'n By making the user INACTIVE means its all assigned role will be revoked")) 
            {
              document.getElementById("confirm_value").value = "Yes";
            } 
           else
           {
            document.getElementById("confirm_value").value = "No";
           }
        }
   else
   {
    document.getElementById("confirm_value").value = "active";
   }
}
}//endFun
实际上,

我正在母版页和更新面板中使用脚本管理器,因此为了摆脱此错误,我设置了ScriptManeger的"脚本模式="发布",它现在可以工作了,该错误不再出现。这是帮助我的链接http://msdn.microsoft.com/en-us/library/bb344940%28v=vs.110%29.aspx