I have tried this code to raise a manual exception
protected void test ()
try
{
throw new Exception("HI"); //line22
}
catch (Exception ex) { lblerror.Text = ex.ToString(); }
but received exception below
System.ArgumentException: HI at Project_Test_M_Test.btnsubmit_Click(Object sender, EventArgs e) in D:\Project\Test\M_Test.aspx.cs:line 22
I want to see error message that I have send not this.
ex.Messageto the user would be useful. Please read the MSDN guidelines on throwing exceptions