Hi everyone,
I’m having a problem with the Login control on my new web application. I don’t have much experience with ASP.NET 2.0 so I would appreciate if someone could take a look at this post and maybe suggest a solution.
I have VS 2005 Professional Edition and in it I’ve created a simple web application (site). All it is supposed to do is to allow registered users to log in and therefore grant them access to some pages. Here is what I managed to do until I encountered problems.
Application is running on my machine on which I have IIS installed.
The basic structure of the application looks like this:
http://localhost/MyApplication
App_Data
ASPNETDB_TMP.MDF
Restricted_Dir
Restricted.aspx
Web.config
Default.aspx
Login.aspx
Web.config
From Visual Studio I’ve started ASP.NET WAT which automatically created a Membership data store in the App_Data subdirectory of my application and added one user without any problems. I’ve checked the database tables to make sure the user is really created and it was there.
I have SQL 2005 Express edition.
I’ve modified the Web.config file in the root of the application by setting the authentication mode to Forms.
I’ve modified the Restricted_Dir/Web.config by adding this:
<authorization>
<deny users="?" />
</authorization>
The Login.aspx page contains only Login control which I've just dragged and dropped without making any modifications to it.
When I try to visit the Restricted.aspx page first I'm redirected to the Login.aspx page which is fine because Restricted.aspx page is restricted for unautorized visitors. Then I enter my user name and password and page just refreshes and again I see the Login page, but I was supposed to be redirected to the Restricted.aspx page. If I enter wrong user name and/or password then it displays a message to try again which is fine.
I have no idea what I’m doing wrong.
I hope I’ve managed to explain it well.
I would really appreciate if someone could jump in with the sollution.
Thanx.
Spiro