Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP 3 Classic ASP Active Server Pages 3.0 > Classic ASP Databases
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 28th, 2004, 12:43 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
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

Reply With Quote
  #2 (permalink)  
Old July 28th, 2004, 07:05 AM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
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
Reply With Quote
  #3 (permalink)  
Old July 29th, 2004, 11:16 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
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


Reply With Quote
  #4 (permalink)  
Old July 29th, 2004, 12:00 PM
Friend of Wrox
 
Join Date: Jun 2003
Location: Harrisburg, PA, USA.
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
Reply With Quote
  #5 (permalink)  
Old July 30th, 2004, 12:39 AM
Authorized User
 
Join Date: Jul 2004
Location: , , .
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

Reply With Quote
  #6 (permalink)  
Old July 30th, 2004, 02:57 AM
Friend of Wrox
 
Join Date: Oct 2003
Location: Cairo, , Egypt.
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
Reply With Quote
  #7 (permalink)  
Old April 3rd, 2006, 10:49 AM
Registered User
 
Join Date: Apr 2006
Location: , , .
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

Reply With Quote
  #8 (permalink)  
Old April 5th, 2006, 01:28 PM
Friend of Wrox
 
Join Date: May 2005
Location: , , Norway.
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

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 12:04 AM.


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