The simplest thing to do is to use a label control and normally it will
not be visible. I also like to set the font color to red.
<asp:Label id=errMsg runat=server fore-color=red visible=false />
Then in the code, when I detect the error,
If(thatErrorThing)
{
errMsg.Text = "Some type of message";
errMsg.Visible = true;
return;
}
in the page load event, always do
errMsg.Text = "";
errMsg.Visible = false;
This will work very nicely and the
user will not have to deal with any
annoying alert window.