troubleshooting Question

How to programatically append to existing ValidationSummary (VB solution)

Avatar of katamatic
katamatic asked on
13 Comments2 Solutions1570 ViewsLast Modified:
Hi everyone - not sure how to accomplish this - I hope someone can help (VB please).

I have a database insert (via a DetailsView) which uses the standard ASP.NET 2 validation controls, i.e.

asp:RequiredFieldValidator       to pinpoint what to validate (and specify the text for an associated error), and

asp:ValidationSummary        to collate and display all the error message from the RequiredFieldValidators

This worked fine - but now I have a dynamically generated checkboxlist for which I need to check at least one field is selected (and of course .NET validation doesn't cater for checkboxlists).

I'm actually already calculating how many of the checkboxes have been ticked, so identifying a zero result isn't the problem - what I'd like to do (and don't have a clue how) is incorporate an error message resulting from such a zero result in the existing 'ValidationSummary' (i.e. so it appears at the same time, as part of the same list).

Thanks for looking.

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 2 Answers and 13 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 2 Answers and 13 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros