Application_Error 优先于 Page_Error
我在页面中有 Page_Error 方法引发错误,在 global.asax 中有 Application_Error 。当Page抛出异常时,执行的例程是Application_Error。但对于那个特定页面,我希望在 Page_Error 中进行不同的处理。有什么办法可以实现吗?
谢谢, 帕维尔
也许是因为上传的文件太大而引发异常(我测试了文件上传页面如何处理大于 web.config 设置的文件)并且 Page_Error 尚未连接?
I have both Page_Error method in page that raises error, and Application_Error in global.asax. When Page throws exception, executed routine is Application_Error. But for that one particular page I would like to have different handling in Page_Error. Is there any way to achieve it?
Thanks,
Pawel
P.S. Perhaps it is because exception being thrown is caused by too large file being uploaded (I tested file upload page how it handles files bigger then web.config setting) and Page_Error is not yet wired?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从相同的 Page_Error 函数中,您可以检查页面,如果是您看到的页面,则您有不同的行为。
下一个方法是从具有不同行为的页面内部。
From the same the function of Page_Error you can check for the page and if is the one you look you have diferent behavior.
The next way is from inside the page with the diferent behavior.