Restrict access

Discussion in 'ASP.NET / ASP.NET Core' started by the butler, May 17, 2005.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I know there is a way to do this but can't find the soultion!?

    What I want to do is restirct access to a particular page on my site to a specific user. There is is a way using the web.config to deny access to a particular page within a web application, whilst allowing access to the rest of the site to anonyomus users. Does anyboy know what the setting is?
     
  2. Keith

    Thank you for your reply. I have had a look at the documentation, I don't know if I have got my self in a mess trying to get to the solution, but it would help if you could answers these questions?

    1) does the restricted page need to be in a sub directory of the main application?
    2) does the sub directory need to be a web application in it's own right?
    3) does the <location> tag need to be in web.config of the root of the main application or that of the new directory?

    answers to these questions would help, I think I'm at the stage of not seeing the woods for the tree's with this issue!!!

    thanks the butler
     
  3. You can. Put the restricted page in a separate directory and use the *location* element in your web.config to restrict access. Look up location element in the VS.NET help for an example.

    Keith Payne
    Technical Marketing Solutions
    http://www.tms-us.com
     
  4. Here are some answers on your questions


    1) does the restricted page need to be in a sub directory of the main application?


    --> no, the location can also be an aspx-page <location path="RestrictedPage.aspx"></location>, www.MySite.com/RestrictedPage.aspx has restricted access


    other possibilities:


    2) does the sub directory need to be a web application in it's own right?


    --> you don't need a subdirectory, but a subdirectory inherits from the root of the webapplication
    3) does the <location> tag need to be in web.config of the root of the main application or that of the new directory?


    -->if you use a directory, you don't really need a different web.config file to restrict access to a specific directory (see 1)



    Success


    --
    Steurm
    www.steurm.net/steurm
    [​IMG]
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page