Sign In| Join
Get Help:Ask a Question in our Forums|Report a Bug|More Help Resources
Last post Aug 30, 2007 10:03 AM by Mikesdotnetting
0 Points
9 Posts
Aug 30, 2007 05:27 AM|LINK
try
{
cn.Open();
cmd.ExecuteNonQuery();
}
Response.Write(ee.Message);
I tried it using javascript but Iam getting the message What I wrote ,but I want to get the returned exception.
could any body help me out from this ..
regards
kapil.....................
All-Star
154941 Points
19870 Posts
Moderator
MVP
Aug 30, 2007 10:03 AM|LINK
catch (Exception ee)
Page.ClientScript.RegisterStartupScript(this.GetType(), "PopupScript", "alert('" + ee.Message + "');", true);
vvpnkapil
0 Points
9 Posts
I want to show the excetion in message box in asp.Net webpage
Aug 30, 2007 05:27 AM|LINK
try
{
string str = "insert into employee(empid,empname,empgrade,empdept,empsal) values(" + TextBox1.Text + ",'" + TextBox2.Text + "','" + TextBox3.Text + "'," + TextBox4.Text + "," + TextBox5.Text + ")";SqlCommand cmd = new SqlCommand(str, cn);cn.Open();
cmd.ExecuteNonQuery();
}
catch (Exception ee) {Response.Write(ee.Message);
}
I tried it using javascript but Iam getting the message What I wrote ,but I want to get the returned exception.
could any body help me out from this ..
regards
kapil.....................
Mikesdotnett...
All-Star
154941 Points
19870 Posts
Moderator
MVP
Re: I want to show the excetion in message box in asp.Net webpage
Aug 30, 2007 10:03 AM|LINK
try
{
string str = "insert into employee(empid,empname,empgrade,empdept,empsal) values(" + TextBox1.Text + ",'" + TextBox2.Text + "','" + TextBox3.Text + "'," + TextBox4.Text + "," + TextBox5.Text + ")";SqlCommand cmd = new SqlCommand(str, cn);cn.Open();
cmd.ExecuteNonQuery();
}
catch (Exception ee)
{Page.ClientScript.RegisterStartupScript(this.GetType(), "PopupScript", "alert('" + ee.Message + "');", true);
}
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter