请问大家,在c#的windwos应用程序中,可以有MessageBox.show()来显示一些提示信息,但在web应用程序中,没有这样的函数,那要在try{} catch{}的catch{}里面弹出异常提示信息,该怎么办呢?多谢!

解决方案 »

  1.   

    try{...}
    catch{
    string js = "<script language=javascript>alert('{0}');</script>";
    HttpContext.Current.Response.Write(string.Format(js,message ,toURL));
    }
      

  2.   

    try{}
    catch(Exception ee)
                {
                
                    string strScript = "window.alert('操作失败');window.returnValue =true;window.focus();window.opener=null; window.close();";
                    ScriptManager.RegisterClientScriptBlock(this.Page, this.GetType(), "失败", strScript, true);
                }