1

这发生在我的开发机器上,并且相同的代码库正在生产中工作。所以我认为这是一个 IIS/框架问题。它影响所有页面。

在两台服务器上,Page_Validators 均已正确设置:

<script type="text/javascript">
<!--
var Page_Validators =  new Array(document.getElementById("ValidatorInsurancePayerRequired"),
document.getElementById("ValidatorCheckPostDateRequired"),
document.getElementById("ValidatorCheckPostDateFormat"),
document.getElementById("ValidatorCheckNumberRequired"),
document.getElementById("ValidatorCheckTotalRequired"),
document.getElementById("ValidatorCheckTotalFormat"));
// -->
</script>

但是,在我的开发机器上,它不会呈现设置验证属性的脚本块:

<script type="text/javascript">
<!--
var ValidatorInsurancePayerRequired = document.all ? document.all["ValidatorInsurancePayerRequired"] : document.getElementById("ValidatorInsurancePayerRequired");
ValidatorInsurancePayerRequired.controltovalidate = "txtPayer";
ValidatorInsurancePayerRequired.errormessage = "<br>Insurance Payer Is Required";
ValidatorInsurancePayerRequired.display = "Dynamic";
ValidatorInsurancePayerRequired.evaluationfunction = "RequiredFieldValidatorEvaluateIsValid";
ValidatorInsurancePayerRequired.initialvalue = "";
.
. all other Page Validators
.
// -->
</script>

我尝试运行 aspnet_regiis -c 来重新安装验证脚本。失败了,我尝试了 -e (删除),然后是 -i (安装)。

有任何想法吗?

4

1 回答 1

2

您正在运行哪些版本的 .NET/IIS?如果这是 2.0 实现,请尝试将其放入您的 web.config 中的 system.web 部分,看看会发生什么:

<xhtmlConformance mode="Legacy"/>

如果您使用 ASP.Net 开发服务器运行,会发生这种情况吗?

此外,如果在开发中启用了跟踪,请尝试禁用它。

缺少这几个建议,我真的需要更多关于您的环境的信息,以便进一步提供帮助。

于 2011-07-22T12:33:40.350 回答