如何处理asp.net中的错误 [英] How to handle errors in asp.net
问题描述
我开发了一个互联网网站,我使用如下的href将用户重定向到特定网站。
I have developed a internet site and I am using href as below to redirect user to a specific site.
导航门户
导航系统
Nav Portal
Navision system
现在的问题是,对于那些有权访问它的人来说完全没问题,但如果没有访问权限,则会显示如下错误消息。
连接到SQL Server ICTFINSRV02时登录失败。
现在我想显示友好的错误消息。任何想法我怎么能处理这个。
Now the issue is that for those who has access to it is totally fine but if one does not have access then a error message is shown as below.
The login failed when connecting to SQL Server ICTFINSRV02.
Now i want to display a friendly error message. Any idea how can i handle this.
推荐答案
现在问题对于那些有权访问它的人来说是完全没问题,但是如果没有访问权限,则会显示如下错误消息。
连接到SQL Server ICTFINSRV02时登录失败。
Now the issue is that for those who has access to it is totally fine but if one does not have access then a error message is shown as below.
The login failed when connecting to SQL Server ICTFINSRV02.
检查此KB
登录到SQL Server时登录失败错误消息 [ ^ ]
查看这些文章,进行友好的例外管理
用户友好异常处理 [ ^ ]
.NET中的异常处理最佳实践 [ ^ ]
Check this KB
"Login failed for user" error message when you log on to SQL Server[^]
Check these articles, for friendly exception management
User Friendly Exception Handling[^]
Exception Handling Best Practices in .NET[^]
这篇关于如何处理asp.net中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!