Let login page protect all but one page.

F

feng

Right now I have my login.aspx protects all the pages in
my web application. This is done through the following
configuration:
<authentication mode="Forms">
<forms name="MyWeb" path="/" loginUrl="Login.aspx"
protection="All" timeout="30">
</forms>
</authentication>

But now what I need is to exclude one page from this
protection. In another word, if a use try to open this
page without login, he/she will be allowed. For all the
other pages, however, it still act the same way before --
he/she get redirected to the login page.

How do I do this one page exclution?

Thanks
 
C

Curt_C [MVP]

the <location> tag in the Web.config will do this for you.
Simply put something like this after the </system.web> tag.

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top