即使validate函数返回true,页面回发也是如此

时间:2013-04-01 14:54:08

标签: javascript jquery asp.net

我正在使用ASP.NET 4.0,JS和Jquery进行一些验证。我的js在验证运行后抛出此错误并返回false。它还允许发回帖子。

JS摘录抛出错误:

 var eventArgs = new Sys.WebForms.EndRequestEventArgs(error, data ? data.dataItems : {}, executor);
        Sys.Observer.raiseEvent(this, "endRequest", eventArgs);
        if (error && !eventArgs.get_errorHandled()) {
            throw error;
        }

我的完整错误消息:

SCRIPT5022: Sys.WebForms.PageRequestManagerServerErrorException: Index was outside the bounds of the array. 
ScriptResource.axd, line 938 character 13

我的JS:

  if (regex) {
                result = patt.test($(this).val());
            } if (!result) {
                //return false;
                $(this).focus();
                alert("Please enter the " + failed_type + " in the following format: " + format);
                return false;
            }

按钮:

<asp:Button ID="Update" runat="server" 
        Text="Update" CssClass="button" 
        TabIndex="4" OnClientClick="return update_Click(event);" OnClick="Update_Click" /> 

调用堆栈:

PageRequestManager$_endPostback,ScriptResource.axd line 938
PageRequestManager$_parseDelta,ScriptResource.axd line 1653
PageRequestManager$_onFormSubmitCompleted,ScriptResource.axd line 1414
Anonymous Function, ScriptResource.axd, line627
Anonymous function, ScriptResource.axd, line 4337
raise, ScriptResource.axd, line 7247 
WebRequest$completed, ScriptResource.axd, line 7251
WebRequest$completed, ScriptResource.axd, line 7251 

0 个答案:

没有答案