i found out that this is in the base class to my class (which is inherited
from customvalidator)
protected override void AddAttributesToRender(System.Web.UI.HtmlTextWriter
writer)
{
/// TODO: Get rid of the Custom EvaluationFunction
Attributes.Remove("evaluationfunction");
Attributes["evaluationfunction"] = "CustomValidatorEvaluateFunction";
base.AddAttributesToRender(writer);
writer.AddAttribute("requiredfield", RequiredField.ToString().ToLower());
writer.AddAttribute("validatewhenempty",
ValidateEmptyText.ToString().ToLower());
writer.AddAttribute("label", Label);
writer.AddAttribute("validationGroup1", ValidationGroup1);
}
i tried the same remove() function as above in my overriden method but no
luck :(
"TS" <manofsteele1@nospam.nospam> wrote in message
news:OHJf1rg1HHA.1164@TK2MSFTNGP02.phx.gbl...
> 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?
>
>