如何在不向用户显示的情况下恢复运行时错误? [英] How to recover a run-time error without displaying it to the user?
本文介绍了如何在不向用户显示的情况下恢复运行时错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在不向用户显示错误的情况下恢复运行时错误?
How to recover a run-time error without displaying it to the user?
推荐答案
将global.asax文件添加到您的项目中,然后在
add a global.asax file to your project , and there , in
protected void Application_Error(object sender, EventArgs e)
{
//handle errors
}
并创建一个页面以将用户重定向到该页面.
但是,如果您想从根本上解决此问题,请在重要的操作中使用try catch语句分别处理每个错误!
and make a page to redirect user to that page.
but if you want basically solve this problem , in important actions use try catch statement to handle each error separately!
这篇关于如何在不向用户显示的情况下恢复运行时错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文