如果我的web.config有:web.config中的自定義錯誤頁面會錯誤信息丟失嗎?
<customErrors mode="Off" defaultRedirect="CustomErrorPage.aspx">
<error statusCode="401" redirect="~/CustomErrorPage.aspx?statusCode=401" />
<error statusCode="403" redirect="~/CustomErrorPage.aspx?statusCode=403" />
<error statusCode="404" redirect="~/CustomErrorPage.aspx?statusCode=404" />
...
</customErrors>
現在在我的CustomErrorPage.aspx,我怎麼能得到類似我怎麼看到黃屏錯誤頁面的堆棧跟蹤信息時,有沒有自定義錯誤頁,這是輸出到瀏覽器?
或者,因爲這是重定向到customerrorpage.aspx,在這一點上基本上是錯誤的,我不能訪問異常信息?
這是一個具有複雜虛擬目錄等的遺留應用程序,因此我可以在這一點上輕鬆地刪除其中一個錯誤庫。
因此,我不能得到server.lasterror然後正確? – loyalflow
是的,我讀到的方式是默認的customError模式做了重定向,這會丟失錯誤信息。 – Gromer