Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login for Newbie

Status
Not open for further replies.

AlanDI1

Programmer
Apr 20, 2003
56
Hi -

I am just starting to use ASP.NET 2.0 and am running thru the examples. I am trying "creating a web site with membership and login". I have actually gotten the appropriate tables added to the Northwind sample SQL database and all the configuration stuff in web.config to work. The "ASP.NET configuration" screens seem to work and allow me to add users and define access rules.

I created a default.aspx and login.aspx as described in the walk-thru. The default.aspx has a loginstatus object and a loginview object. The loginview object has two templated, one for "anonymoustemplate" and one for "loggedintemplate".

When I start the site the default page appears and I click the login link. The login.aspx page appears and I login (I am pretty sure the login works because if I type an incorrect password I get an error message).

The login.aspx page has a login task and a validationsummary.

After I click the login button with a correct user and password it returns to the default.aspx page. BUT, it does not seem to realize that I have sucessfully logged in.

What am I missing about making the connection that I have already successfully logged in?

Thanks for your help
 
Why do you think you havent logged in?

Have you tried adding a loginstatus control to the default page?

It should ether ask you to login if you arn't or logout if you are..

Rob
 
Thanks for all you assistance and time.

The Default.aspx page has a "LoginView" with the Anonymous Template which says "please login" and the LoggedIn Template says "Welcome" with the "LoginName". The Login.aspx page has a "Login" task and a "ValidationSummary" so I know if the password, ID, etc. was wrong.

When you click the "Log In" button it returns to the Default.aspx page but it still has the Login link (rather than the Log out and does not show the Users Name) and the message says "please login".

The long and the short of it is there was either something wrong with the way I added the membership tables to the Northwind sample database or the way I attached it. I created a new database and set it up using the aspnet_regsql utility and it seems to be working.

I wish there was a simple step by step database setup document for doing this.

Thanks all.
 
So I guess I shouldn't have figured this was fixed so quickly. Everything works fine when I run the site using the "run in browser" option in the development environment.

However, when I run in IE it goes back to the same (not recognizing that it is logged in) behavior. I am running IIS. The site is in a folder in the INETPUB\ directory and I defined the site to IIS.

What is the difference?

BTW - SQL Server is running on the same server and the server is Windows 2003.

Thanks
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top