您的位置:首页 > 编程语言 > ASP

ASP.NET 1.1无法提交的问题

2005-02-25 17:22 295 查看
     今天在产品里发现了一个bug,多个aspx页面都无法提交,点了提交按纽都没有反应,初步猜测是Validate的问题。详细的解决过程就不写了,将最后的结论总结如下:

    .NET Framework 1.1的补丁对Validator有影响,如果使用补丁前的WebUIValidation.js,会导致包含有Validators的页面无法提交。

     打补丁前,WebUIValidation.js中的ValidatorCommonOnSubmit如下:

protected void RegisterValidatorCommonScript()

protected void RegisterValidatorCommonScript()

      if (this.Page.IsClientScriptBlockRegistered("ValidatorIncludeScript"))

                  return;

      }

      string text1 = Util.GetScriptLocation(this.Context);

      string text2 = HttpRuntime.FormatResourceString("Validator_missing_script", text1 + "WebUIValidation.js");

      string text3 = HttpRuntime.FormatResourceString("Validator_wrong_script", "WebUIValidation.js", "125", "\" + Page_ValidationVer + \"");

      string text4 = string.Empty;

      if (this.Page.Request.IsLocal)

                  object[] objArray1 = new object[3]             text4 = string.Format("\r\n<script language=\"javascript\" type=\"text/javascript\">\r\n<!--\r\nvar Page_ValidationActive = false;\r\nif (typeof(clientInformation) != \"undefined\" && clientInformation.appName.indexOf(\"Explorer\") != -1) {{\r\n    if (typeof(Page_ValidationVer) == \"undefined\")\r\n        alert(\"      }

      else

                  text4 = string.Format("\r\n<script language=\"javascript\" type=\"text/javascript\">\r\n<!--\r\nvar Page_ValidationActive = false;\r\nif (typeof(clientInformation) != \"undefined\" && clientInformation.appName.indexOf(\"Explorer\") != -1) {{\r\n    if ((typeof(Page_ValidationVer) != \"undefined\") && (Page_ValidationVer == \"      }

      this.Page.RegisterClientScriptFileInternal("ValidatorIncludeScript", "javascript", text1, "WebUIValidation.js");

      this.Page.RegisterStartupScript("ValidatorIncludeScript", text4);

      this.Page.RegisterOnSubmitStatement("ValidatorOnSubmit", "if (!ValidatorOnSubmit()) return false;");

}

  花了些时间找出问题原因,记录下来,以便查询。

  再有就是建议没有打.NET Framework 1.1补丁的,尽早打补丁,同时不要在发布产品的时候发布任何.NET Framework中带的文件,包含.js和.dll。
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐