In web.config, how to specify a page that can be accessed without login?

Discussion in 'ASP .Net' started by TaeHo Yoo, Jul 19, 2003.

  1. TaeHo Yoo

    TaeHo Yoo Guest

    In my current web.config, I have these lines
    -----------------------------------------------------------
    <authentication mode="Forms">
    <forms name="frmAuthentication" loginUrl="login.aspx" />
    </authentication>
    -----------------------------------------------------------
    How do I need to modify it, so that contactUS.aspx should be accessed
    without logining in.

    Thanks a lot in advance,




    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    TaeHo Yoo, Jul 19, 2003
    #1
    1. Advertising

  2. TaeHo Yoo

    Teemu Keiski Guest

    In the current web.config (that has this <authentication> setting) you
    probably have authorization set as:

    <authorization>
    <deny users="?" />
    </authorization>

    that would impact all pages in the application by default.

    Now to the answer, you can specify different <authorization> for a specific
    page or subfolder by using <location> tag. Set this <location> element
    outside the <system.web> tags in current web.config, but of course inside
    <configuration> elements.

    <location path="contactUS.aspx">
    <system.web>
    <authorization>
    <allow users="*" />
    </authorization>
    </system.web>
    </location>

    Now remembering the setting in generally to deby unauthorized users,
    unauthorized users can now access login.aspx and contactUS.aspx pages in
    your application.

    --
    Teemu Keiski
    MCP, Designer/Developer
    Mansoft tietotekniikka Oy
    http://www.mansoft.fi

    AspInsiders Member, www.aspinsiders.com
    ASP.NET Forums Moderator, www.asp.net
    AspAlliance Columnist, www.aspalliance.com


    "TaeHo Yoo" <> wrote in message
    news:...
    > In my current web.config, I have these lines
    > -----------------------------------------------------------
    > <authentication mode="Forms">
    > <forms name="frmAuthentication" loginUrl="login.aspx" />
    > </authentication>
    > -----------------------------------------------------------
    > How do I need to modify it, so that contactUS.aspx should be accessed
    > without logining in.
    >
    > Thanks a lot in advance,
    >
    >
    >
    >
    > *** Sent via Developersdex http://www.developersdex.com ***
    > Don't just participate in USENET...get rewarded for it!
     
    Teemu Keiski, Jul 19, 2003
    #2
    1. Advertising

  3. TaeHo Yoo

    TaeHo Yoo Guest

    Thanks a lot Teemu Keiski.
    However, a trick I have at the moment is when I access a page instead of
    saying http://www.AWebSite.com/ContactUs.aspx

    I do like
    http://www.AWebSite.com/default.aspx?page_id=1
    where ContactUs.ascx's page_id = 1

    I created ContactUs user control and using page_id I load this user
    control to default.aspx.
    In this scenario how to make ContactUs.ascx page accessable to anyboy?

    Thanks a lot




    *** Sent via Developersdex http://www.developersdex.com ***
    Don't just participate in USENET...get rewarded for it!
     
    TaeHo Yoo, Jul 29, 2003
    #3
    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. Martin
    Replies:
    2
    Views:
    420
    Martin
    Jul 22, 2003
  2. =?Utf-8?B?bGVueWFkbw==?=
    Replies:
    2
    Views:
    418
    =?Utf-8?B?bGVueWFkbw==?=
    May 20, 2005
  3. thomas
    Replies:
    3
    Views:
    708
    thomas
    Oct 12, 2006
  4. vikramp
    Replies:
    2
    Views:
    1,255
    vikramp
    Oct 20, 2006
  5. CSharpner
    Replies:
    0
    Views:
    1,047
    CSharpner
    Apr 9, 2007
Loading...

Share This Page