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

Ask a Question related to ASP.NET General, Design and Development.

  1. #1

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

    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 [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    TaeHo Yoo Guest

  2. Similar Questions and Discussions

    1. Strange problem with Forms authentication: After successfull login, login page is still displayed
      Hi there I have a quite strange problem with my ASP.NET-Application. The application has being deployed one year ago and worked fine till last...
    2. dynamic userControl can't be accessed during page load
      I have a userControl that I create based on how many rows I retrieve in a dataset. I add the control to my page but can't access it during the...
    3. What code would I use to ensure a page is accessed by another within my site?
      I'm trying to prevent "leeching"..so that users must enter my site to get to the files. Does anyone know a script that will work? Thanks a...
    4. How to assign two or more login page in Web.config?
      Hi,Good Afternoon. Now my web application need 2 login page. What can I do? how can I modify the web.config to meet the requirement? Thanks a lot!
    5. Web config file in another app being accessed in error!!??
      Hi I am noticing some strange behaviour in some asp.net pages that I have put together and am hoping someone can explain to me what is...
  3. #2

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

    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
    [url]http://www.mansoft.fi[/url]

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


    "TaeHo Yoo" <yootaeho@yahoo.com> wrote in message
    news:uKLee2dTDHA.2180@TK2MSFTNGP10.phx.gbl...
    > 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 [url]http://www.developersdex.com[/url] ***
    > Don't just participate in USENET...get rewarded for it!

    Teemu Keiski Guest

  4. #3

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

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

    I do like
    [url]http://www.AWebSite.com/default.aspx?page_id=1[/url]
    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 [url]http://www.developersdex.com[/url] ***
    Don't just participate in USENET...get rewarded for it!
    TaeHo Yoo Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139