Forms Authentication errror

S

Sumaira Ahmad

Hi,

Please help me with this..
I am trying to use Forms Authentication in a sample project. I
basically want to have two folders in my application , one in which
I store pages that can be accesed without authentication and one
which can be accessed only by authenticated users..

In my Anonymous folder:
there is a default.aspx - which is a start up page
I have also included a web.config file in that folder with following
config:
<authentication mode="Forms" />
<authorization>
<allow users="?" />
</authorization>

My secret folder's web.config is as follows:
<authentication mode="Forms" />
<authorization>
<deny users="?" />
</authorization>

My main root directory has a Login page and a web.config file
configured as follows:

<authentication mode="Forms" />
<authorization>
<allow users="*" />
</authorization>


But when I am trying to run it it gives me error:

Configuration Error
Description: An error occurred during the processing of a
configuration file required to service this request. Please review
the specific error details below and modify your configuration file
appropriately.

Parser Error Message: It is an error to use a section registered as
allowDefinition='MachineToApplication' beyond application level.
This error can be caused by a virtual directory not being configured
as an application in IIS.

Source Error:


Line 44: by Microsoft that offers a single logon and core
profile services for member sites.
Line 45: -->
Line 46: <authentication mode="Forms" />
Line 47:
Line 48: <!-- AUTHORIZATION


Source File:
c:\inetpub\wwwroot\FormsAuth1WithFolders\Anon\web.config Line: 46

Is it ok to have more than one web.config files in an application??
DOes some configuration need to be done for it??Please let me know...
I have been loosing sleep over it for the last two days.
My basic aim is to seggregate those pages that can be accessed by
anybody and those that need to be accessed only by authorized
users...I am using the sample provided in ASP.NET Unleashed...

If reqd I can also send me application.. It is a very tiny one, with
only 3 pages..:)...

Any help would be highly appreciated.

Thanks,
Sumaira
 

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

Similar Threads


Members online

Forum statistics

Threads
473,733
Messages
2,569,439
Members
44,829
Latest member
PIXThurman

Latest Threads

Top