如何处理asp.net中的错误 [英] How to handle errors in asp.net

查看:103
本文介绍了如何处理asp.net中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我开发了一个互联网网站,我使用如下的href将用户重定向到特定网站。







  • I have developed a internet site and I am using href as below to redirect user to a specific site.


  • u



    导航门户



    导航系统




    Nav Portal


    Navision system






  • 每个都显示为块,当用户点击块时重定向到网站。

    现在的问题是,对于那些有权访问它的人来说完全没问题,但如果没有访问权限,则会显示如下错误消息。

    连接到SQL Server ICTFINSRV02时登录失败。

    现在我想显示友好的错误消息。任何想法我怎么能处理这个。



    each appear as block and when user click on the block it redirects to the site.
    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屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆