Validating ASP.NET checkbox (and similar) controls.


blog.dmbcllc.com There are controls in the .NET framework that can not be wired to the standard validation controls. The checkbox control is one example. You can’t use the requiredfieldvalidator because it has a value. It’s either true or false. And you can’t provide a regularexpressionvalidator or one of the others because it is a boolean value. So, if I want to make sure a check box is checked before the user continues, for example. And, I want to make sure that the error message shows up in the error summary control like every other error, how do I do that?

11 thoughts on “Validating ASP.NET checkbox (and similar) controls.”

  1. Thank you very much for the information, but why wouldn’t you just use:

    args.IsValid = Checkbox1.Checked

    Seems much simpler.

    Anyway, thanks again.

Leave a Reply to tlsonger Cancel reply