0

i have 20 checkboxes in usercontrol ... i wanna do whole coding in user control ...

how to show msg box if user forgot to check asp.net checkbox control on button click .. ?

1
  • Reference from your previous post: if user haven't checked any check box then on button click you will get vCheckedCBCount = 0;then in JavaScript u can show alert message easily. Commented Jan 27, 2011 at 12:44

2 Answers 2

1

You should provide a CustomValidator for every Checkbox which validates on client- and serverside if the Checkbox is checked. http://www.joe-stevens.com/2009/08/12/using-the-customvalidators-clientvalidationfunction/

Sign up to request clarification or add additional context in comments.

3 Comments

No i have 25 checkboxes in usercontrol and button1 i want if user forgot to check any of the checkboxes ( means user have to select atleast 1 checkbox to proceed on button click)
Do you have these checkboxes in any container like panel or table?
ya i have checkboxes in div and then table
0

Create a public method on the user control that returns a boolean indicating if the data entry in the control is correct. Call that method from your page on the button click event. If data entry is valid, continue processing;else show an error message.

2 Comments

Can u have a coding example for this ?
I will post one shortly for you

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.