Multiple pages for Location tags?

Discussion in 'ASP .Net' started by tshad, Jan 17, 2005.

  1. tshad

    tshad Guest

    Can I set up multiple pages in the same Location tag? I thought I saw
    somewhere that I could. I tried the following, but it doesn't work.
    ***************************************************
    <configuration>
    <system.web>
    <authorization>
    <deny users="?" />
    </authorization>
    </system.web>
    <location path="default.aspx,addLogon.aspx,LogonForgot.aspx">
    <system.web>
    <authorization>
    <allow users="*" />
    </authorization>
    </system.web>
    </location>
    </configuration>
    **************************************************************

    The following does work, but since they are the same I would like to use the
    same location tag if possible.
    **********************************************************************************
    <configuration>
    <system.web>
    <authorization>
    <deny users="?" />
    </authorization>
    </system.web>
    <location path="default.aspx">
    <system.web>
    <authorization>
    <allow users="*" />
    </authorization>
    </system.web>
    </location>
    <location path="addLogon.aspx">
    <system.web>
    <authorization>
    <allow users="*" />
    </authorization>
    </system.web>
    </location>
    <location path="logonForgot.aspx">
    <system.web>
    <authorization>
    <allow users="*" />
    </authorization>
    </system.web>
    </location>
    </configuration>
    **************************************************************************

    Thanks,

    Tom
     
    tshad, Jan 17, 2005
    #1
    1. Advertising

  2. As far as I know you have to use the second one. There is no way to specify
    multiple values in xml.
     
    =?Utf-8?B?U2NvdHQgU2ltb25z?=, Jan 17, 2005
    #2
    1. Advertising

  3. Hi Tom,

    As far as I am aware it is not possible to have multiple entries in the path
    attribute. See
    http://msdn.microsoft.com/library/d...e/html/cpconconfigurationlocationsettings.asp
    for more information.

    It could be that you need to think about the structure of your site. To
    quote MSDN - Using <location> with a missing path attribute applies the
    configuration settings to the current directory and all child directories.

    You may find that easier to implement. If not, multiple <location> elements
    it is.

    Regards,

    Stuart
    MCSD, MCT

    "tshad" <> wrote in message
    news:%23HExLvL$...
    > Can I set up multiple pages in the same Location tag? I thought I saw
    > somewhere that I could. I tried the following, but it doesn't work.
    > ***************************************************
    > <configuration>
    > <system.web>
    > <authorization>
    > <deny users="?" />
    > </authorization>
    > </system.web>
    > <location path="default.aspx,addLogon.aspx,LogonForgot.aspx">
    > <system.web>
    > <authorization>
    > <allow users="*" />
    > </authorization>
    > </system.web>
    > </location>
    > </configuration>
    > **************************************************************
    >
    > The following does work, but since they are the same I would like to use
    > the same location tag if possible.
    > **********************************************************************************
    > <configuration>
    > <system.web>
    > <authorization>
    > <deny users="?" />
    > </authorization>
    > </system.web>
    > <location path="default.aspx">
    > <system.web>
    > <authorization>
    > <allow users="*" />
    > </authorization>
    > </system.web>
    > </location>
    > <location path="addLogon.aspx">
    > <system.web>
    > <authorization>
    > <allow users="*" />
    > </authorization>
    > </system.web>
    > </location>
    > <location path="logonForgot.aspx">
    > <system.web>
    > <authorization>
    > <allow users="*" />
    > </authorization>
    > </system.web>
    > </location>
    > </configuration>
    > **************************************************************************
    >
    > Thanks,
    >
    > Tom
    >
     
    Stuart A Hill, Jan 17, 2005
    #3
  4. tshad

    Saravana Guest

    You cant specify multiple files in location path. But you can place all
    these files into one folder, and specify that folder name in location path.
    Location path accepts folder name.

    --
    -Saravana
    http://dotnetjunkies.com/WebLog/saravana/
    www.ExtremeExperts.com



    "tshad" <> wrote in message
    news:%23HExLvL$...
    > Can I set up multiple pages in the same Location tag? I thought I saw
    > somewhere that I could. I tried the following, but it doesn't work.
    > ***************************************************
    > <configuration>
    > <system.web>
    > <authorization>
    > <deny users="?" />
    > </authorization>
    > </system.web>
    > <location path="default.aspx,addLogon.aspx,LogonForgot.aspx">
    > <system.web>
    > <authorization>
    > <allow users="*" />
    > </authorization>
    > </system.web>
    > </location>
    > </configuration>
    > **************************************************************
    >
    > The following does work, but since they are the same I would like to use

    the
    > same location tag if possible.
    >

    ****************************************************************************
    ******
    > <configuration>
    > <system.web>
    > <authorization>
    > <deny users="?" />
    > </authorization>
    > </system.web>
    > <location path="default.aspx">
    > <system.web>
    > <authorization>
    > <allow users="*" />
    > </authorization>
    > </system.web>
    > </location>
    > <location path="addLogon.aspx">
    > <system.web>
    > <authorization>
    > <allow users="*" />
    > </authorization>
    > </system.web>
    > </location>
    > <location path="logonForgot.aspx">
    > <system.web>
    > <authorization>
    > <allow users="*" />
    > </authorization>
    > </system.web>
    > </location>
    > </configuration>
    > **************************************************************************
    >
    > Thanks,
    >
    > Tom
    >
    >
     
    Saravana, Jan 18, 2005
    #4
  5. tshad

    tshad Guest

    "Saravana" <> wrote in message
    news:OkP8nkY$...
    > You cant specify multiple files in location path. But you can place all
    > these files into one folder, and specify that folder name in location
    > path.
    > Location path accepts folder name.


    That is what I may have to do. I don't know which is better - 10 files in
    one folder or 10 Location entries.

    Thanks,

    Tom.
    >
    > --
    > -Saravana
    > http://dotnetjunkies.com/WebLog/saravana/
    > www.ExtremeExperts.com
    >
    >
    >
    > "tshad" <> wrote in message
    > news:%23HExLvL$...
    >> Can I set up multiple pages in the same Location tag? I thought I saw
    >> somewhere that I could. I tried the following, but it doesn't work.
    >> ***************************************************
    >> <configuration>
    >> <system.web>
    >> <authorization>
    >> <deny users="?" />
    >> </authorization>
    >> </system.web>
    >> <location path="default.aspx,addLogon.aspx,LogonForgot.aspx">
    >> <system.web>
    >> <authorization>
    >> <allow users="*" />
    >> </authorization>
    >> </system.web>
    >> </location>
    >> </configuration>
    >> **************************************************************
    >>
    >> The following does work, but since they are the same I would like to use

    > the
    >> same location tag if possible.
    >>

    > ****************************************************************************
    > ******
    >> <configuration>
    >> <system.web>
    >> <authorization>
    >> <deny users="?" />
    >> </authorization>
    >> </system.web>
    >> <location path="default.aspx">
    >> <system.web>
    >> <authorization>
    >> <allow users="*" />
    >> </authorization>
    >> </system.web>
    >> </location>
    >> <location path="addLogon.aspx">
    >> <system.web>
    >> <authorization>
    >> <allow users="*" />
    >> </authorization>
    >> </system.web>
    >> </location>
    >> <location path="logonForgot.aspx">
    >> <system.web>
    >> <authorization>
    >> <allow users="*" />
    >> </authorization>
    >> </system.web>
    >> </location>
    >> </configuration>
    >> **************************************************************************
    >>
    >> Thanks,
    >>
    >> Tom
    >>
    >>

    >
    >
     
    tshad, Jan 18, 2005
    #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. Luke Dalessandro
    Replies:
    0
    Views:
    632
    Luke Dalessandro
    Jan 15, 2006
  2. zxo102
    Replies:
    0
    Views:
    448
    zxo102
    Aug 1, 2006
  3. saiho.yuen
    Replies:
    3
    Views:
    547
    kaeli
    Sep 14, 2004
  4. John Bailo

    IE7 shows location even if location=no

    John Bailo, Jan 19, 2007, in forum: Javascript
    Replies:
    4
    Views:
    217
    OmegaJunior
    Mar 11, 2007
  5. Replies:
    2
    Views:
    160
Loading...

Share This Page