?
Solved

errorprovider with validationsummary

Posted on 2011-04-23
2
Medium Priority
?
909 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?
0
Comment
Question by:Berico
2 Comments
 
LVL 11

Expert Comment

by:brutaldev
ID: 35454407
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

0
 
LVL 70

Accepted Solution

by:
Éric Moreau earned 1000 total points
ID: 35456237
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
High user turnover can cause old/redundant user data to consume valuable space. UserResourceCleanup was developed to address this by automatically deleting user folders when the user account is deleted.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…
Suggested Courses
Course of the Month16 days, 18 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question