469,644 Members | 1,973 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,644 developers. It's quick & easy.

validating multiple checkboxes


Can anyone point me in the direction of a solution for validating
multiple checkboxes in an asp.net 2.0 page?

1) This is not a checkboxlist, it is a number of separate checkboxes
2) I do not need to ensure that they are checked, what I am trying to
do is lock down the page to prevent possible code injection. So, the
checkboxes can be either checked or unchecked, I don't care.

I have seen some sample code at http://msdn2.microsoft.com/en-us/library/aa479013.aspx.
I think this is a good start, and I think I can use a call such as

args.IsValid = ((CheckBox.Checked = True) or (Checkbox.Checked
= False))

But the problem I am having is I would like to have several
customvalidator controls share the same ServerValidation subroutine,
and so not have to specify the name of the checkbox control being
validated. So, my main question is really: is there any way to
extract the name of the checkbox from the source or
servervalidateeventargs (the arguments to the servervalidation

Thanks in advance!

-- Ned
Dec 19 '07 #1
0 1446

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Ralph Freshour | last post: by
5 posts views Thread by Stephen | last post: by
6 posts views Thread by jeffsnox | last post: by
2 posts views Thread by forbes | last post: by
7 posts views Thread by mc | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.