Different Login Pages for different secured pages.

Last post 08-06-2007 10:08 PM by TonyMilne. 1 replies.

Sort Posts:

  • Different Login Pages for different secured pages.

    08-06-2007, 6:15 PM
    • Member
      54 point Member
    • MartinT
    • Member since 07-04-2007, 11:47 AM
    • Posts 34

    Hi,

    I'm using Forms authentication.

    On the admin pages, I want an unauthorised user to be sent straight to the login.aspx, but on 1 page (not within the admin section) I'm using the <location path="~/ImageView.aspx"> element and I want an unauthorised user to be sent to the "~/mustlogin.aspx" as this will display further information to the user.

    Is there a way to do it???

     

  • Re: Different Login Pages for different secured pages.

    08-06-2007, 10:08 PM
    Answer
    • Member
      482 point Member
    • TonyMilne
    • Member since 08-05-2007, 8:53 PM
    • Melbourne, Australia
    • Posts 52

    Multiple config files, all named Web.config, can appear in multiple directories. Each Web.config file applies settings to it's own directory and all children directories beneath it.

    Config files in child directories can supply additional settings on top of those inherited from parent directories; they can also be used to override settings defined in parent directories.

    So, if you placed all of your admin pages in a folder called Admin, you could then configure your web.config file (in the root of your web application) to use "~/mustlogin.aspx" as the logon page - and create a second web.config file in the Admin folder, overriding the logon page setting to use "login.aspx".

    Cheers,

    Tones.

    Tony Milne is a co-founder of Inlight Media, a leading Australian web development company.
Page 1 of 1 (2 items)