Click here to Skip to main content
15,893,588 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to allow only authenticated user to acces a pages.I use the FormsAuthenticates mechanism.However when i type the url of a pages other than login page i still able to view it.I expect it to redirect to a login page but that not what i got.Please help me
Posted
Updated 15-Feb-10 22:51pm
v2

If the pages which you are trying to access are in subfolders. Then make sure that there is a web.config file in the subfolder. Now, In this Web.config file. Write below code. deny users="?" in that web.config file.
 
Share this answer
 
v2
How do say you forms authentication is enabled for your web site?

Could you please post the portion of web.config that you use to enable forms authentication?

Here is an example,

XML
<authentication mode="Forms">
  <forms name="yourCookieName"  cookieless="UseUri" loginUrl="Login.aspx" protection="All" timeout="90" slidingExpiration="true"/>
</authentication>
<authorization>
  <deny users="?" />      
</authorization>


Here '?' in deny tag denies anonymous users from accessing the site.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900