T
TS
i want to specify evalutionfunction for my custom validator control. i have
tried many ways to get this to work, but in the end, the evaluationfunction
attribute always gets rendered as the default
"CustomValidatorEvaluateFunction":
<span
id="ctl00_ctl00_ContentMainPlaceHolder_ApplicationContentMainPlaceHolder_cbC
lientSigned" evaluationfunction="CustomValidatorEvaluateFunction"
requiredfield="false" validatewhenempty="false" label="" validationGroup1
mustBeChecked="true" style="color:Red;display:none;"></span>
protected override void AddAttributesToRender(HtmlTextWriter writer){
base.AddAttributesToRender(writer); string x;
//this.ClientValidationFunction = "CheckBoxValidatorEvaluateIsValid";
//writer.AddAttribute("evaluationfunction",
"CheckBoxValidatorEvaluateIsValid", false);
Attributes.Add("evaluationfunction", "CheckBoxValidatorEvaluateIsValid");
writer.AddAttribute("mustBeChecked", MustBeChecked ? "true" : "false",
false);
}
how do i do this correctly? I have tried to also not override
AddAttributesToRender and instead in prerender just add these 2 attributes.
No matter what i do, evaluationfunction gets overwritten somewhere
what can i do?
tried many ways to get this to work, but in the end, the evaluationfunction
attribute always gets rendered as the default
"CustomValidatorEvaluateFunction":
<span
id="ctl00_ctl00_ContentMainPlaceHolder_ApplicationContentMainPlaceHolder_cbC
lientSigned" evaluationfunction="CustomValidatorEvaluateFunction"
requiredfield="false" validatewhenempty="false" label="" validationGroup1
mustBeChecked="true" style="color:Red;display:none;"></span>
protected override void AddAttributesToRender(HtmlTextWriter writer){
base.AddAttributesToRender(writer); string x;
//this.ClientValidationFunction = "CheckBoxValidatorEvaluateIsValid";
//writer.AddAttribute("evaluationfunction",
"CheckBoxValidatorEvaluateIsValid", false);
Attributes.Add("evaluationfunction", "CheckBoxValidatorEvaluateIsValid");
writer.AddAttribute("mustBeChecked", MustBeChecked ? "true" : "false",
false);
}
how do i do this correctly? I have tried to also not override
AddAttributesToRender and instead in prerender just add these 2 attributes.
No matter what i do, evaluationfunction gets overwritten somewhere
what can i do?