Web.Config (location path=)Question

Discussion in 'ASP .Net' started by Patrick Olurotimi Ige, Apr 4, 2005.

  1. I have a Virtual directory FORUMS and the a folder CORP under that
    Directory.
    And i want to add a location path to this folder in web.config but after
    trying the below code it doesn't seem to WORK!!


    Am i missing something ??

    <location path="/Forums/CORP">
    <system.web>
    <customErrors mode="Off" />
    <authorization>
    <allow roles="Corp_Manag/>
    <deny users="?" />
    <authorization>
    </system.web>
    </location>

    I THINK MAYBE I'M NOT PUTTING THE ABOVE CODE IN THE RIGHT PLACE BECOS
    I'M INCLUDING IT IN THE DEFAULT WEB.CONFIG GENERATED BY VSTUDIO.NET

    *** Sent via Developersdex http://www.developersdex.com ***
     
    Patrick Olurotimi Ige, Apr 4, 2005
    #1
    1. Advertising

  2. Patrick Olurotimi Ige

    MattC Guest

    Where are you placing this in the Web.Config?

    MattC
    "Patrick Olurotimi Ige" <> wrote in message
    news:...
    >I have a Virtual directory FORUMS and the a folder CORP under that
    > Directory.
    > And i want to add a location path to this folder in web.config but after
    > trying the below code it doesn't seem to WORK!!
    >
    >
    > Am i missing something ??
    >
    > <location path="/Forums/CORP">
    > <system.web>
    > <customErrors mode="Off" />
    > <authorization>
    > <allow roles="Corp_Manag/>
    > <deny users="?" />
    > <authorization>
    > </system.web>
    > </location>
    >
    > I THINK MAYBE I'M NOT PUTTING THE ABOVE CODE IN THE RIGHT PLACE BECOS
    > I'M INCLUDING IT IN THE DEFAULT WEB.CONFIG GENERATED BY VSTUDIO.NET
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
     
    MattC, Apr 4, 2005
    #2
    1. Advertising

  3. Matt i placed it in the Directory folder!
    I got it working but i noticed can't use:-
    <location path="/Forums/CORP">
    It has to be a FOLDER name or a file name only
    for example <location path="Forums"> or just use
    <location path="Forums.aspx">
    Any other ideas?



    *** Sent via Developersdex http://www.developersdex.com ***
     
    Patrick Olurotimi Ige, Apr 4, 2005
    #3
  4. Patrick Olurotimi Ige

    Brock Allen Guest

    <location> must be inside the <configuration> element -- make sure you have
    that in the web.config that's in the child directory.

    -Brock
    DevelopMentor
    http://staff.develop.com/ballen



    > I have a Virtual directory FORUMS and the a folder CORP under that
    > Directory.
    > And i want to add a location path to this folder in web.config but
    > after
    > trying the below code it doesn't seem to WORK!!
    > Am i missing something ??
    >
    > <location path="/Forums/CORP">
    > <system.web>
    > <customErrors mode="Off" />
    > <authorization>
    > <allow roles="Corp_Manag/>
    > <deny users="?" />
    > <authorization>
    > </system.web>
    > </location>
    > I THINK MAYBE I'M NOT PUTTING THE ABOVE CODE IN THE RIGHT PLACE BECOS
    > I'M INCLUDING IT IN THE DEFAULT WEB.CONFIG GENERATED BY VSTUDIO.NET
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    >
     
    Brock Allen, Apr 4, 2005
    #4
  5. Patrick Olurotimi Ige

    grchuah Guest

    You should place your 'location path' tag at the root of the main folder
    web config file. Right after the web.config's </system.web> tag.

    and notice ur <allow roles="Corp_Manag/> is without the closing
    quotation mark.

    > <location path="/Forums/CORP">
    > <system.web>
    > <customErrors mode="Off" />
    > <authorization>
    > <allow roles="Corp_Manag/>
    > <deny users="?" />
    > <authorization>
    > </system.web>
    > </location>




    --
    grchuah
    ------------------------------------------------------------------------
    Posted via http://www.codecomments.com
    ------------------------------------------------------------------------
     
    grchuah, Nov 5, 2006
    #5
    1. Advertising

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. KQ
    Replies:
    1
    Views:
    453
  2. Patrick Olurotimi Ige

    location path in Web.config

    Patrick Olurotimi Ige, May 12, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    2,015
    Brock Allen
    May 12, 2005
  3. CSharpner
    Replies:
    0
    Views:
    1,060
    CSharpner
    Apr 9, 2007
  4. luqman
    Replies:
    2
    Views:
    797
    luqman
    Jul 11, 2007
  5. mpaine
    Replies:
    0
    Views:
    1,183
    mpaine
    Mar 25, 2010
Loading...

Share This Page