Application_Error does not fire?

前端 未结 2 1812
-上瘾入骨i
-上瘾入骨i 2020-12-19 10:00

In Webform1.aspx.cs:

protected void Page_Load(object sender, EventArgs e)
{
    throw new Exception(\"test exception\");
}

In the Global.as

2条回答
  •  执念已碎
    2020-12-19 10:31

    I found the problem.

    Server.Transfer("ErrUnknown.aspx")
    

    was the cause.

    While trying to view 'ErrUnknown.aspx' directly in the browser I realized I had an error in that page. After correcting it Server.Transfer works

    Was is misleading though is that the event doesn't get fired while debugging the application?

    Anyway.

提交回复
热议问题