catch(SqlException ex)
{
Response.Write("<script>alert('"+ex.Message+"');</"+"script>");
return;
//Global.CloseConnection();
}
{
Response.Write("<script>alert('"+ex.Message+"');</"+"script>");
return;
//Global.CloseConnection();
}
……
Response.Write("<script>alert('"+ex.Message+"');</"+"script>");
return;
……
To : songhtao(三十年孤独) && kinglht(爱新觉罗至尊宝)
将代码改成如下:
问题:还是弹不出窗口!(我的目的是想弹出 警告 窗口!)
catch(SqlException ex)
{
Response.Write("<script>alert('"+"出错:"+ex.LineNumber.ToString()+"\r\n"+"错误信息"+ex.Message+"\r\n"+"');</"+"script>");
//When occur Exception,Close the Connection
return;
Global.CloseConnection();
Response.Redirect("ErrorMsg.aspx");
}
{
Response.Write("<script>alert('"+"出错:"+ex.LineNumber.ToString()+"\r\n"+"错误信息"+ex.Message+"\r\n"+"');</"+"script>");
//When occur Exception,Close the Connection
return;
Global.CloseConnection();
//当窗口还同弹出来时已经重定向了 注释下面行
//Response.Redirect("ErrorMsg.aspx");<-----
}