section registered as allowdefinition Error and Secure Folder

Discussion in 'ASP .Net' started by ruffeo, Feb 7, 2007.

  1. ruffeo

    ruffeo Guest

    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.
    ruffeo, Feb 7, 2007
    #1
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Replies:
    23
    Views:
    1,097
    Juan T. Llibre
    Nov 13, 2006
  2. jc
    Replies:
    1
    Views:
    798
    Michael Nemtsev [MVP]
    Oct 28, 2008
  3. AAaron123
    Replies:
    4
    Views:
    1,484
    AAaron123
    Jan 21, 2009
  4. Dominick Baier [DevelopMentor]
    Replies:
    5
    Views:
    814
    Dominick Baier [DevelopMentor]
    Jul 5, 2006
  5. Neal Miller
    Replies:
    1
    Views:
    358
    Neal Miller
    Sep 20, 2006
Loading...

Share This Page