ASP.NET Client Validation Javascript Partially Rendering
This is happening on my development machine and the same codebase is working in production. So I believe this to be an IIS/Framework issue. It affects all pages.
On both servers, the Page_Validators are setup correctly:
<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>
However, on my development machine it does not render the script block that sets the validation properties:
<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>
I have tried running aspnet_regiis -c to reinstall the validation scripts. Failing that I tried that with a -e (remove) followed by -i (install).
Any ideas?
What versions of .NET/IIS are you running? If this is a 2.0 implementation, try putting this in your web.config in the system.web section and see what happens:
<xhtmlConformance mode="Legacy"/>
Does this happen if you run using the ASP.Net Development Server?
Also, if tracing is enabled in development, try disabling it.
Short of these few suggestions, I'd really need a lot more info on your environments in order to assist further.
精彩评论