There is a solution I used in one asp.net application:
In page's html insert hidden field and name it, say,
hidField. Give it attribute runat="server";
in c# (vb) class (code behind) for this page declare this
hidden field like this:
protected System.Web.UI.HtmlControls.HtmlInputHidden
hidField;
Then use its value attribute to give it any message you
need when you need. Say, hidField.Value = "Freaking
message";
Then insert a script function inside of your html,
something like this:
<script>
function checkError()
{
if(document.all.hidField && document.all.hidField.value !
= "")
alert(hidField.value);
hidField.value = "";
}
</script>
And finally add onLoad event (jscript event) to your body
tag in your html:
<body onLoad="checkError();">
Now every time you need to send any message from your c#
(vb) to the client, just assign any string to the hidField
value in your c# (vb).
That's it.
Regards.