这发生在我的开发机器上,并且相同的代码库正在生产中工作。所以我认为这是一个 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 (安装)。
有任何想法吗?