在将代码迁移后,edge浏览器访问发现RequiredFieldValida控件对textbox验证失效,从RequiredFieldValidator控件生成的js中(WebResource.axd)知道是在
if (typeof(val.evaluationfunction) == "function") {
val.isvalid = val.evaluationfunction(val);
if (!val.isvalid && Page_InvalidControlToBeFocused == null &&
typeof(val.focusOnError) == "string" && val.focusOnError == "t") {
ValidatorSetFocus(val, event);
}
}
中 typeof(val.evaluationfunction)不是function而引起的,RequiredFieldValidator控件生成的html标签中evaluationfunction="RequiredFieldValidatorEvaluateIsValid",而在IE浏览器中生成的是
evaluationfunction="function RequiredFieldValidatorEvaluateIsValid(val) {
return (ValidatorTrim(ValidatorGetValue(val.controltovalidate)) != ValidatorTrim(val.initialvalue))
}“