Creating a Generic Message Display Page for ASP.NET
Find out how to create a generic message class that displays an attractive, informative message in your Web applicationwith just one line of code.
by Rick Strahl
April 26, 2006
SP.NET reduces the need for generic message pages with its postback-based metaphor. Because most pages post back to themselves rather than going off to other pages, you can often redisplay messages on the original page with a message or error header. Not only is this convenient to code with .NET by simply adding a label or even a custom error display control to show the message, but it's also better for the user who sees the message in the context of the operation that produced the error or action that caused the message.
Creating messages in your Web application should be quick, easy, and most importantly, consistent.
They should look like they belong with the rest of the application even if an error occurs. How often have you created a new page to display simple text or a notification message to your users? Wouldn't it be better if you could reuse an existing template and simply pass in a few parameters to tell it to render an application-specific message? In this article I will show you how to create a reusable Message Display class that reduces displaying messages generically in your application to a single line of code.
It's quick, easy and you get access to all the articles on DevX.
This registration/login is to allow you to read articles on devx.com. Already a member?
To become a member of DevX.com create your Member Profile by completing the form below. Membership is free!