C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Reviews   Communities   Interview   Jobs   Projects   Training   Your Ad Here    
Silverlight Games | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Polls | Revenue Sharing | Lobby | Gift Shop |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...






Forums » .NET » ASP.NET »

Error while Authenticating a form


Posted Date: 15 Oct 2008      Posted By: Cathrin      Member Level: Gold     Points: 1   Responses: 12



I wanted to disable form authentication to a particular page......I was told to include a line <location path ="FolderName">
But that has resulted in an error
Error 1 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.

I created the virtual directory for that application yet the error is not resolved....





Responses

Author: gomathinayagam    15 Oct 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

will u add that within <system.web>
:

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

Gomathi Nayagam

Please Rate my answer if it has helpful to you



Author: Cathrin    15 Oct 2008Member Level: GoldRating: 1 out of 5     Points: 1

I dont understand what you mean...Could you explain it?


Author: gomathinayagam    15 Oct 2008Member Level: GoldRating: 1 out of 5     Points: 1

actually its working fine for me !

i am using vs 2005 wat ur version?

Gomathi Nayagam

Please Rate my answer if it has helpful to you



Author: Cathrin    15 Oct 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Mine is also VS 2005..I should put the page for which authentication should be disabled inside a folder and that folder name should be mentioned in location path na..Am I right?
This is my web config file
<?xml version="1.0"?>

<configuration>
<appSettings/>
<connectionStrings/>
<location path ="NewFolder1">
<system.web>
<compilation debug="true"/>
<authentication mode="Forms">
<forms name ="loginCookie" loginUrl="Home.aspx" protection="All" timeout="30" path="/">
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
<customErrors mode="Off"></customErrors>
</system.web>
</location>
</configuration>

I have the ForgotPassword page inside the NewFolder1



Author: gomathinayagam    15 Oct 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

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

add this u miss allow users deny users ???

Gomathi Nayagam

Please Rate my answer if it has helpful to you



Author: gomathinayagam    15 Oct 2008Member Level: GoldRating: 3 out of 53 out of 53 out of 5     Points: 3

<configuration>
<appSettings/>
<connectionStrings/>
<location path ="NewFolder1">
<system.web>
<authorization>
<allow users="*"/>
<deny users="*"/>
</authorization>
</system.web>
</location>
<system.web>
<compilation debug="true"/>
<authentication mode="Forms">
<forms name ="loginCookie" loginUrl="Home.aspx" protection="All" timeout="30" path="/">
</forms>
</authentication>
<authorization>
<deny users="?" />
</authorization>
<customErrors mode="Off"></customErrors>
</system.web>
</configuration>


change like this

Gomathi Nayagam

Please Rate my answer if it has helpful to you



Author: gomathinayagam    15 Oct 2008Member Level: GoldRating: 3 out of 53 out of 53 out of 5     Points: 3

u can add number of locations.
like
<location path ="NewFolder1">
<system.web>
<authorization>
<allow users="*"/>
<deny users="*"/>
</authorization>
</system.web>
<location path="Admin">
<system.web>
<authorization>
<allow roles="Admin"/>
<deny users="*"/>
</authorization>
</system.web>
</location>

here i use roles also. refer this

Gomathi Nayagam

Please Rate my answer if it has helpful to you



Author: Cathrin    15 Oct 2008Member Level: GoldRating: 1 out of 5     Points: 1

Hi,
Thanks alot yaar... It Worked Could you explain those liness



Author: gomathinayagam    15 Oct 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

* All Users, including authenticated and anonymous users.
? All Non-Authenticated, or Anonymous, users.

so if i use ? in deny users ? means all are denied.

* in allow users means only authenticated.

so for authenticated pages
<deny users="?"/>
<allow users="*"/>

Gomathi Nayagam

Please Rate my answer if it has helpful to you



Author: gomathinayagam    15 Oct 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

am give u a example with roles.

have u used role based authentication?

have u used sql role provider, profile provider, membership provider classes?

Gomathi Nayagam

Please Rate my answer if it has helpful to you



Author: Cathrin    15 Oct 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

Hi Gomathinayagam,
Thanks once again....I have not used roles based authentication,SQL role Provider,profile provider,membership provider classes....
By the way how do we categorize users as authenticated and anonymous



Author: gomathinayagam    16 Oct 2008Member Level: GoldRating: 2 out of 52 out of 5     Points: 2

if you not using profile, u can only able to authenticate the user,
if he is authenticate or anonymous.

most sites provide profile for anonymous also.

A good web site will remember the user. users favorite color scheme etc.

these all posible with profile system.

if you not using Asp.net 2.0 profile system u cant remember the anonymous user favourites.

Gomathi Nayagam

Please Rate my answer if it has helpful to you



Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.


Next : open a ppt file
Previous : hi All How To Send Mail Through ASP. Any Free SMTP Server
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages



dotNet Slackers

About Us    Contact Us    Privacy Policy    Terms Of Use