Exclude from Form Authentication

  • Thread starter Thread starter Islam Elkhayat
  • Start date Start date
I

Islam Elkhayat

How can i exclude some files from the Form Authentication.. my welcome page
and even custom error pages (404) is not working before authenticate.
need help
 
You can exclude specific files from forms auth with a location node in
web.config:
<location path="404.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
</location>

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

It's often easier to just group the pages that don't require auth into
a public folder and allow access to the whole folder at once:

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

More here:
http://msdn.microsoft.com/library/d.../en-us/cpgenref/html/gngrflocationelement.asp
- Jon
http://weblogs.asp.net/jgalloway
 
Thanx alot.. I have searched alot to solve this...
I was trying to put files in a public folder by add web.config to the public
folder but this generate exception even if i excluded it from the project i
must delete it to work..
Is the web.config only one file for all my application so i can have only
one file in my solution??
 

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

Back
Top