Hi,
On my asp .net site, I want a login page so that when the user is logged in, a few extra links are made visible on the header control (.ascx). Also, there will only be about 4-6 users logging in here, I also want to give each one the ability to edit their own info from a database table. I have allready tried "Forms" authentication and this is what happens.

<authentication mode="Forms" />
 		  <Forms name=".ASPXSession" loginUrl="FacLogin.aspx" protection="All" />
 			<credentials passwordFormat = "Clear"> 
 				 
 <user name="admin" password="admin"/> 				 
 			</credentials>
 		</forms>	
 		</authentication>

Of course, this doesn't work, making me really quite angry and frustrated. The error message I receive is as follows:

Parser Error Message: Unrecognized configuration section 'forms'


There is little or no documentation on this error and I feel like killing myself someone.

Please help :sad:

Just a long shot but fix one thing and let me know the result:

<authentication mode="Forms" />
 		  <Forms name=".ASPXSession" loginUrl="FacLogin.aspx" protection="All" />
 			<credentials passwordFormat = "Clear"> 
 				 
 <user name="admin" password="admin"/> 				 
 			</credentials>
 		</forms>

change the <Forms name=".ASPXSession".... to <forms name=".ASPXSession"...

it can be as simple as a capital letter in wrong place that will throw it off. At least that has been my experience!

Comments
Thanks man

hi, I ended up fixing that one. What happened was, I didn't realize the sensitivity of the program an dso I just copied code directly off the net, of course, space characters and whatever else was included in this, hence the error. I ended just retyping the whole lot, then it worked fine.


Thanks for the help tho!

Slade

What I want of my login system is that when a user is logged in (there is only about 5 and all are declared in the web.config), I want two more imagebuttons to appear in the header, what code will I need to do that?

N.B. I'm using VB .NET

if [b]HttpResponse.Cookies[/b]  = FormsAuthentication.Authenticate then
imgButton1.visible = true

Is that on the right track? Any ideas guys?

I notice from several of your posts that you have the user set the specific controls they want on the site. Interesting, but you are giving up a great deal of control to the user, and thus making your work harder.

You should have standard template pages ,that have themes to them (i.e. styles) that the user can select, but keep them to a minimum.

But then this is just suggestion... I am not sure of what you are trying to ultimately do. Only guessing...

But from the code you have provided I would say you are on the right track!

On one other thing. Are you setting all the user authenication data in the web.config file? Why not use an access DB to store this?

try this :
<authentication mode="Forms" >
<Forms name=".ASPXSession" loginUrl="FacLogin.aspx" protection="All" />
<credentials passwordFormat = "Clear">
</authentication>

your authentication tag is being closed and hence it doesnot encapsulate the <forms > tag .. and hence your web.config is not being parsed correctly

cheers

This article has been dead for over six months. Start a new discussion instead.