Wrox Programmer Forums
|
Classic ASP Databases Discuss using ASP 3 to work with data in databases, including ASP Database Setup issues from the old P2P forum on this specific subtopic. See also the book forum Beginning ASP.NET Databases for questions specific to that book. NOT for ASP.NET 1.0, 1.1, or 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Databases section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 28th, 2004, 12:43 AM
Authorized User
 
Join Date: Jul 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default LOGIN PAGE (does not link to the next page)

Hi All,

I am trying to setup a Login Page and I am having troubles. Everytime I input my Username and Password, the page redirection should go to my Default.aspx page... but it doesn't. It just reloads the Login Page. However, when I type an incorrect username and password, the intended message actually returns what I want, "Login Failed. Please try again".

This is what I did:
1.) I created the dataset for the Login Page asking it to check with the database (MSAccess)
2.) After the </form> tag I entered the following code:

<%
if dsLogin.RecordCount > 0 then
Session("sessUsername") = Request.Form("tfUsername")
FormsAuthentication.RedirectFromLoginPage("tfUsern ame.value", true)
else if ((Request.Form("tfUsername"))) <> Nothing _
OR ((Request.Form("tfPassword"))) <> Nothing
response.Write("Login Failed. Please Try Again.")
end if
%>

3.) I created a Default.aspx page to say "Thank You. Please click the button below to continue"
4.) I then added the following code to my web.config file:
    <system.web>
    <customErrors mode="Off" />
    <authentication mode="Forms">
    <forms name = "SECAUTH" loginUrl="Login.aspx">
    <credentials />
    </forms>
    </authentication>
    <authorization>
    <deny users="?" />
    </authorization>
    </system.web>

... in between the </appSettings> and </configuration> sections

5.) I created the application in IIS

So, it should work right? Nope. I type in my username and password, and it reloads the original Login Page. It should be accessing the next page that I called Default.aspx which returns a simple Thank You......

Can someone help me?

Thx,
Jim

 
Old July 28th, 2004, 07:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

Hey,

Can you actually go to the default.aspx page after you login successfully? In addition, how do you validate the users?

And lastly, this may be your issue, you need a:

<allow users="*"/>

after the <deny>. This allows authenticated users to access the web site.

Brian
 
Old July 29th, 2004, 11:16 AM
Authorized User
 
Join Date: Jul 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi,

Thanks for replying. No I can't even view any other file. When I open any file (other pages that I created), it opens the Login Page. As you mentioned, I added <allow users="*"/> after the <deny> in web.config.

When I type in the Login and Password, the new page (which is the login page AGAIN), shows the following in the address bar:

http://localhost/LeanSigma-ASP/Login...2fdefault.aspx

So, its trying to get to the Default Page, but it just doesn't load. The Login Page just keeps showing. No other page is viewable.

Any thoughts?
Jim


 
Old July 29th, 2004, 12:00 PM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 1,998
Thanks: 0
Thanked 3 Times in 3 Posts
Default

In the default page, are you manually redirecting to the login page? What does your default page look like?

Brian
 
Old July 30th, 2004, 12:39 AM
Authorized User
 
Join Date: Jul 2004
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Brian,

Thanks for your help. I placed <allow users="*"/> before the <deny users="?" /> and it worked. I had it the other way around.

Thanks a bunch.

The webconfig file now reads
        <system.web>
    <customErrors mode="Off" />
    <authentication mode="Forms">
    <forms name = "SECAUTH" loginUrl="Login.aspx">
    <credentials />
    </forms>
    </authentication>
    <authorization>
    <allow users="*"/>
    <deny users="?" />
    </authorization>
    </system.web>

Thanks again..
Jim

 
Old July 30th, 2004, 02:57 AM
Friend of Wrox
 
Join Date: Oct 2003
Posts: 336
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to alyeng2000
Default

i think that the order should be
    <deny users="?" />
        <allow users="*" />

Ahmed Ali
Software Developer
 
Old April 3rd, 2006, 10:49 AM
Registered User
 
Join Date: Apr 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Quote:
quote:Originally posted by bmains
 In the default page, are you manually redirecting to the login page? What does your default page look like?

Brian
Hi, I have the same problem but only in IE. The site works in Firefox.

After clicking on the login button, the page redirects to itself.
But if I type default.aspx after the above, I can access the site.

Any help is appreciated.

Thanks

 
Old April 5th, 2006, 01:28 PM
Friend of Wrox
 
Join Date: May 2005
Posts: 189
Thanks: 0
Thanked 0 Times in 0 Posts
Default

... can I just ask Sullivan; how does the password being validated in this code..?

Med vennlig hilsen
grstad






Similar Threads
Thread Thread Starter Forum Replies Last Post
Bookmark this page link in Master page dschips ASP.NET 2.0 Basics 5 January 8th, 2007 11:05 AM
Login page back to original page pablohoney Classic ASP Basics 1 October 3rd, 2006 07:09 PM
Help with link to other page by button in C# richie86 ASP.NET 1.0 and 1.1 Basics 6 October 29th, 2005 11:59 AM
Newbie Help. Login to unique login page per user Kainan Classic ASP Professional 10 May 3rd, 2005 07:47 AM
Load one page according to the link morpheus Classic ASP Basics 5 November 19th, 2003 03:42 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.