Hello -
I'm new to ASP.NET and I like the validation controls.
But -
I would like to use the CustomValidator to check for string length.
Problem:
Say I have 6 text boxes, all requiring validation restricting string lengths.
If I use the CustomValidator as is, I am limited to providing only the function to validate with and no additional arguments.
I would like use a ValidateStringLength function and pass it the max length of the string / control that's being validated.
I've seen messages on other boards that says I can't pass an additional argument to my validation function and someone suggested that a user create a new instance on the BaseValidator or CustomValidator that allows that functionality.
Anyone here ever do that or have examples of how it's done (creating a truly custom validator)?
Again - I would just like to be able to add an argument / variable that tell what length the maximum char. count is in a control that's validated by the CustomValidator
I'm new to ASP.NET and I like the validation controls.
But -
I would like to use the CustomValidator to check for string length.
Problem:
Say I have 6 text boxes, all requiring validation restricting string lengths.
If I use the CustomValidator as is, I am limited to providing only the function to validate with and no additional arguments.
I would like use a ValidateStringLength function and pass it the max length of the string / control that's being validated.
I've seen messages on other boards that says I can't pass an additional argument to my validation function and someone suggested that a user create a new instance on the BaseValidator or CustomValidator that allows that functionality.
Anyone here ever do that or have examples of how it's done (creating a truly custom validator)?
Again - I would just like to be able to add an argument / variable that tell what length the maximum char. count is in a control that's validated by the CustomValidator