section registered as allowdefinition Error and Secure Folder

R

ruffeo

There has been alot on the web about this web.config error that
happens in visual studio .net 2005. Most people think this has to do
with IIS, but .net 2005 doesn't run on IIS but a developer version
called ASP.net development server. The problem is caused by the
web.config having the authentication section inside a subfolder or a
location tag. The solution is simple make one authentication section
in the main part of the root web.config, see the following:

Root Directory Web.Config:
<system.web>

<authentication mode="Forms" >
<forms
name=".ASPXFORMSAUTH"
loginUrl="~\Admin\SecureCheckin.aspx"
protection="All"
timeout="180" defaultUrl="~\Admin\somepage.aspx >
</forms>
</authentication>
</system.web>


One addtion to the root director Web.Config to get the secure folder
to work:

<location path="Admin" >

<system.web>

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

</authorization>

</system.web>

</location>


That is all there is to it for a quick secure folder within an ASP.NET
application. No other web.config files are needed.
 

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

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,021
Latest member
AkilahJaim

Latest Threads

Top