I have an ASP.NET(2.0, C#) web application, and I wanted to know how to display all the general errors that could occur on the master page using divs.
For example if there is an ‘add new user’ page, all the fields that had problems will be shown something like this:
The following Error(s) Occured:
- …
- …
I am using a master page, so I wanted to know how I could use a div in there, with a label maybe, to display errors from any of the content pages.
Thank you.
I would recommend using a Panel.
Then just add the errors to
lstErrorsprogrammatically if they occur and set the visibility to true.EDIT: I originally didn’t read the part about the Master page. One issue you’re probably going to run into is finding that control from your content page. Here is one way you can do so: