I often use the Page.RegisterStartupScript in an event handler to write a
javascript alert that can be based on a condition allows the entire page
loads before the alert pops up...very handy for me...
(note, this method also makes the message tablerow visible and writes to a
literal control in that row)
private void UserMessage(string Message, bool Popup)
{
StatusMessage.Text=Message;
ShowMessage.Visible=true;
if (Popup)
{
Page.RegisterStartupScript("StatusMessage","<SCRIP T
LANGUAGE=\"JavaScript\">alert('"+ Message +"');</Script>");
}
}
"REB" <ru**@bjorgaard.com> wrote in message
news:uR**************@TK2MSFTNGP09.phx.gbl...
What is the code in C# to have a pop-up when a function throws an error?
catch(Exception ex)
{
Show pop up with text from ex in it?
}