We help IT Professionals succeed at work.

Check out our new AWS podcast with Certified Expert, Phil Phillips! Listen to "How to Execute a Seamless AWS Migration" on EE or on your favorite podcast platform. Listen Now

x

errorprovider with validationsummary

Berico
Berico asked
on
Medium Priority
922 Views
Last Modified: 2012-05-11
Webforms has a validationsummary that is connected to the validators. Is there any way to have errorprovider to send its error to a label for example instead of tootip?
Comment
Watch Question

You can enumerate the errors by looping though the control collection on your form. Won't be fast on big forms with loads of controls but will work.

Add a label that you want the errors to be displayed on and write something like this:
 
myErrorLabel.Text = string.Empty;

foreach (Control ctrl in myErrorProvider.ContainerControl.Controls)
{
  myErrorLabel.Text += myErrorProvider.GetError(ctrl) + Environment.NewLine;
}

Open in new window

Senior .Net Consultant
CERTIFIED EXPERT
Top Expert 2016
Commented:
Unlock this solution with a free trial preview.
(No credit card required)
Get Preview
Unlock the solution to this question.
Thanks for using Experts Exchange.

Please provide your email to receive a free trial preview!

*This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

OR

Please enter a first name

Please enter a last name

8+ characters (letters, numbers, and a symbol)

By clicking, you agree to the Terms of Use and Privacy Policy.