为了账号安全,请及时绑定邮箱和手机立即绑定

ErrorPage无法捕获Exception

ErrorPage无法捕获Exception

DIEA 2018-11-20 05:02:48
普通頁面:protected void Page_Load(object sender, EventArgs e)    {        throw new Exception("hello");    }ErrorPage: protected void Page_Error(object sender, EventArgs e)    {        Response.Write(Server.GetLastError().GetBaseException().Message);        Server.ClearError();    }Web.Config<customErrors mode="On" defaultRedirect="ErrorPage.aspx"/> 問題:ErrorPage.aspx的Server.GetLastError()总是为空,如何才能获取出错页面的Exception Message呢?
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 939 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号