Sunday, May 08, 2005

Displaying Messages to the user

Most of the time we need to display messages to the user these messages can be as simple as "Data has been inserted". The most common pattern that we use is something like this:

int result = Get the value from the database identifying that if the data has been inserted or not

if(result==1)
Label1.Text = "Data has been inserted";
else
Label1.Text = "Data not inserted";

This is a common pattern that is being repeated all over the application. You can replace this by making a class which deals with messages. You can also store the messages in Sql Server 2000 as well as Xml file.

I wrote an article on this issue which will be soon published on www.codersource.net.


No comments: