11
rated 0 times
[
15]
[
4]
/ answers: 1 / hits: 21053
/ 13 Years ago, thu, june 23, 2011, 12:00:00
I am trying to show exception message through javascript alert box.
Here is the sample code.
public static void HandleException(Page page, Exception ex)
{
string message = ex.Message.ToString();
ScriptManager.RegisterClientScriptBlock(page, page.GetType(), , alert('+message+');, true);
}
It runs if i give literal values for the string variable.
e.g.
string message = Hello World;
But it fails if I give message = ex.Message;
Any Idea?
More From » c#