User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 456,273 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,320 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 155973 | Replies: 74 | Solved
Closed Thread
Join Date: Dec 2004
Location: Washington DC
Posts: 10
Reputation: Javaknight is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
Javaknight's Avatar
Javaknight Javaknight is offline Offline
Newbie Poster

Re: Can Give Simple ASP.Net Login Page (Using VB.Net) With SQL Server Database??

  #21  
Jan 4th, 2005
Originally Posted by Paladine
Well the SQL looks sound to me. This line of code redirects the client on successful login:

FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, False) ' ||||| default.aspx Page!

and if not,

Response.Redirect("Denied.aspx")

Not sure if that helps. But SQL does not affect the Redirection unless you condition statement (which I am not sure what it looks like) bypasses this redirection.

Thanks for answering Paladine!

Thats very helpful. (When one doesn't know whats wrong, one has a tendency to waste time with things that are really inconsequential.) The nature of this problem disturbs me because the application does not seem to be executing the conditional in the DBConnection function. If I leave one of the text boxes blank the validation works, however if I type in any user name and password, the page just seems to refresh. I should have mentioned that I have attempted to execute this code without using the codebehind method of programming. (I can never get it to work for me.)

I think that I will have to keep playing with it because I think that I have modified the example beyond the point where it can be recognizably assisted remotely. I will let you know what I come up with.
 
Join Date: Dec 2004
Location: Washington DC
Posts: 10
Reputation: Javaknight is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
Javaknight's Avatar
Javaknight Javaknight is offline Offline
Newbie Poster

Solution Re: Can Give Simple ASP.Net Login Page (Using VB.Net) With SQL Server Database??

  #22  
Jan 5th, 2005
Originally Posted by Javaknight
I will let you know what I come up with.

Paladine,

I finally solved the problem. :cheesy: I was not getting a response from the page because my webform button was not set up correctly. :o

This is the code that I modified from the original:

<asp:button id="cmdSubmit" text="Submit" runat="server" borderstyle="Solid" onclick="cmdSubmit_Click">

I can only assume that I had to add this onclick element because I am not using the codebehind method of programing. I'll attempt to keep this in mind in the future.

Thanks for your help!
 
Join Date: Jan 2005
Posts: 2
Reputation: SPYRO is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
SPYRO SPYRO is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page (Using VB.Net)

  #23  
Jan 8th, 2005
Really good job!

Here is an idea for a little improvement in the Try block:
(Just to keep the coding happy )


Try
If MyConn.State = ConnectionState.Closed Then
MyConn.Open()
End If

Return MyCmd.ExecuteScalar()

Catch ex As Exception
lblMessage.Text = "Error Connecting to Database!"
Finally
MyConn.Close()
End Try
 
Join Date: Jan 2005
Posts: 1
Reputation: Dragtoth is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
Dragtoth Dragtoth is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page (Using VB.Net)

  #24  
Jan 13th, 2005
Hi Paladine,

firstly thank you so much for the code coz it really helps me get started. After compiling and running the login.aspx and typed in the username - Admin / password - Admin (what is in the Northwind.mdb), it still prompt me invalid login. Why is this so?

And also, is there any way to encrypt or hide the password stored in Northwind.mdb? Because I see there's no security if anybody can just open and see the password right? Thanks in advance for the help. GREAT SITE!!
 
Join Date: Feb 2003
Location: Canada
Posts: 786
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Rep Power: 9
Solved Threads: 26
Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: Simple ASP.Net Login Page (Using VB.Net)

  #25  
Jan 14th, 2005
Thanks Dragtoth, glad it helps...well kind of anyway.

Ok, have you gone through the debugging and scene what value(s) are being passed to the DB? That would be my first step. Always confirm what is being sent to the DB, you may type it correctly in the login boxes but that does not mean it is being passsed correctly to the DB.

PM me if you have the answer or that still doesn't solve it.

As for Encryption, I haven't had a chance to sit down and write the code for that, but you could use SHA1 encryption (part of the .NET environment) and there are some things you can do to mask the password in Access (i.e. Input Mask in the table design view)

Hope this helps.

I will try to sit down soon and write an encryption version of this.
Assistant Manager, Regional Pharmacy Information Systems
TLC Services Website (Under Construction)
Updated : ASP.Net Login Code
 
Join Date: Jan 2005
Posts: 2
Reputation: doradylam is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
doradylam doradylam is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page (Using VB.Net)

  #26  
Jan 31st, 2005
Originally Posted by Paladine
Thanks Dragtoth, glad it helps...well kind of anyway.

Ok, have you gone through the debugging and scene what value(s) are being passed to the DB? That would be my first step. Always confirm what is being sent to the DB, you may type it correctly in the login boxes but that does not mean it is being passsed correctly to the DB.

PM me if you have the answer or that still doesn't solve it.

As for Encryption, I haven't had a chance to sit down and write the code for that, but you could use SHA1 encryption (part of the .NET environment) and there are some things you can do to mask the password in Access (i.e. Input Mask in the table design view)

Hope this helps.

I will try to sit down soon and write an encryption version of this.

Hi Paladine

I am having the same trouble as the others... I have done everything as stated in the code, but still no matter what is typed in the username or password text boxes, the label states "Invalid Login" and I can't figure out why for the life of me!

Please help if you can!

Thanks in advance!
 
Join Date: Jan 2005
Posts: 2
Reputation: doradylam is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
doradylam doradylam is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page (Using VB.Net)

  #27  
Jan 31st, 2005
Also,

" Dim LoginSQL As String"

seems to have been declared for no further use or references throughout...

THanks
 
Join Date: Feb 2005
Posts: 1
Reputation: MarkyMarc is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 1
MarkyMarc MarkyMarc is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page (Using VB.Net)

  #28  
Feb 10th, 2005
Hi,

Maybe you can help me.

I have an existing web site done with ASP pages. Now we would like to add a login using the ASP.NET Forms method.

Is there a way to have the user redirected to the login when requesting an ASP page when he is not loged in? Maybe a cookie to check or something?

We tried to convert to ASP pages to ASPX pages but it would require redoing the web site almost entirelly and unfortunatelly this is not an option right now.

Thank you
 
Join Date: Feb 2005
Posts: 12
Reputation: Kendel is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 1
Kendel Kendel is offline Offline
Newbie Poster

Re: Simple ASP.Net Login Page (Using VB.Net)

  #29  
Feb 22nd, 2005
Hi everyone,

Another .net newbie in the house. Could someone please put everything together for SQL DB? I am trying to follow the instruction on Access and then change some stuffs to SQL but it didn't work. I have no clue what I was doing wrong.

Thank you so much.

-kendel
 
Join Date: Feb 2003
Location: Canada
Posts: 786
Reputation: Paladine has a spectacular aura about Paladine has a spectacular aura about Paladine has a spectacular aura about 
Rep Power: 9
Solved Threads: 26
Colleague
Paladine's Avatar
Paladine Paladine is offline Offline
Master Poster

Re: Simple ASP.Net Login Page (Using VB.Net)

  #30  
Feb 24th, 2005
Hi folks, sorry been really busy lately. Ok, I will redo the whole thing in Access, SQL and Oracle (just in case).

So bare with me till the weekend.

Later
Assistant Manager, Regional Pharmacy Information Systems
TLC Services Website (Under Construction)
Updated : ASP.Net Login Code
 
Closed Thread

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 2 (0 members and 2 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 6:36 pm.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC