以下代码怎么没有实现出错后转到ERROR.ASPX啊??
   try
        {
            string id = Request.QueryString["id"].ToString();
            int bid = Convert.ToInt32(id);
            DataSet ds = new DataSet();
            ds = clm.findbookmessage(bid);//我把BID去掉后出现了错误,但没有转到ERROR.ASPX页。出现了一个  “/web”应用程序中的服务器错误的提示。
            this.GridView1.DataSource = ds.Tables[0];
            this.GridView1.DataBind();
            this.GridView1.Dispose();
            getdatepin();
        }
        catch (Exception)
        {
            Response.Redirect("error.aspx");
        }

解决方案 »

  1.   

    findbookmessage要接受参数,你没传,在调页面时就会报编译错.此时程序还没执行呢.
      

  2.   

    Response.Redirect("~/error.aspx"); 
    你那样写是跟当前页面同一目录下的,跳转写个相对路径啦汗,两星怎么来的...
      

  3.   

    你把try去掉 看出什么错误
      

  4.   

    同意1楼,你那是编译错误,不是捕获的异常,所以catch里的没有执行
      

  5.   

    支持,你先把try去掉,看执行在哪里出错了,再改过来嘛
      

  6.   

    to:leaohong 
    二星就是这样来的.