There are a few solutions; if you are comfortable with CSS, here's a very flexible solution:
Create an appropriately styled Panel
that resembles a "Message Box", put a Label
in it and set its Visible
property to false
. Then whenever the user needs to see a message after a postback (e.g. pushing a button), from codebehind set the Label
s Text
property to the desired error message and set the Panel
's Visible
property to true
.