Different Login Pages for different secured pages. RRS feed

  • Question

  • User-509309720 posted


    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???


    Monday, August 6, 2007 6:15 PM


  • User766599685 posted

    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".



    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, August 6, 2007 10:08 PM