Exception Handling declarative security

Discussion in 'ASP .Net Security' started by Patrick, Apr 23, 2004.

  1. Patrick

    Patrick Guest

    I'm reading myself into security and ASP.Net.

    I have written some demo code and now I'm wondering how you deal with
    exception handling when you use declarative security

    I have a method with the following attribute

    [PrincipalPermissionAttribute(SecurityAction.Demand, Name="Patrick")]
    private void MyFunction()
    {
    DoSomething().......
    }

    When I'm not athorized I will be redirected to a default errorpage.

    My question is what is the best way to handle. 1)Redirect to a
    customized errorpage or 2) is there a way to handle the exception so I
    can raise a user friendly message to my frontend.

    Thanks in advance

    gr Patrick
     
    Patrick, Apr 23, 2004
    #1
    1. Advertisements

  2. Patrick

    Chris Rolon Guest

    You could subscribe to UnhandledException event handler on the current app
    domain. In that way you could return a friendlier message.

    Chris Rolon

    "Patrick" <> wrote in message
    news:...
    > I'm reading myself into security and ASP.Net.
    >
    > I have written some demo code and now I'm wondering how you deal with
    > exception handling when you use declarative security
    >
    > I have a method with the following attribute
    >
    > [PrincipalPermissionAttribute(SecurityAction.Demand, Name="Patrick")]
    > private void MyFunction()
    > {
    > DoSomething().......
    > }
    >
    > When I'm not athorized I will be redirected to a default errorpage.
    >
    > My question is what is the best way to handle. 1)Redirect to a
    > customized errorpage or 2) is there a way to handle the exception so I
    > can raise a user friendly message to my frontend.
    >
    > Thanks in advance
    >
    > gr Patrick
     
    Chris Rolon, Apr 25, 2004
    #2
    1. Advertisements

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. MS Newsgroups

    Declarative Security in ASP .net

    MS Newsgroups, Oct 17, 2003, in forum: ASP .Net
    Replies:
    1
    Views:
    552
    Natty Gur
    Oct 19, 2003
  2. =?Utf-8?B?SmVmZkRvdE5ldA==?=

    Declarative use of sqlDataSource in ASP.net 2.0 and Exception Hand

    =?Utf-8?B?SmVmZkRvdE5ldA==?=, Feb 1, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    3,010
    Steven Cheng[MSFT]
    Feb 2, 2006
  3. Alexandre Poitras
    Replies:
    0
    Views:
    564
    Alexandre Poitras
    Oct 28, 2005
  4. marwis1978
    Replies:
    0
    Views:
    483
    marwis1978
    Mar 20, 2007
  5. MS Newsgroups

    Declarative Security in ASP .net

    MS Newsgroups, Oct 17, 2003, in forum: ASP .Net Security
    Replies:
    0
    Views:
    198
    MS Newsgroups
    Oct 17, 2003
  6. Chris Stev

    Custom HttpHandlers and Declarative Security

    Chris Stev, Sep 15, 2004, in forum: ASP .Net Security
    Replies:
    0
    Views:
    190
    Chris Stev
    Sep 15, 2004
  7. saleryan

    Declarative Security

    saleryan, Feb 18, 2006, in forum: ASP .Net Security
    Replies:
    0
    Views:
    166
    saleryan
    Feb 18, 2006
  8. mpaine

    Declarative event handling from usercontrol

    mpaine, Sep 30, 2009, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    917
    mpaine
    Sep 30, 2009
Loading...