1,105,416 Community Members

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

Member Avatar
Paladine
Master Poster
812 posts since Feb 2003
Reputation Points: 138 [?]
Q&As Helped to Solve: 28 [?]
Skill Endorsements: 5 [?]
Team Colleague
 
1
 

This is sample code for a ASP.Net Login page (using Visual Basic.Net code behind) with OleDB connection to an Access Database using ADO.Net.

The datebase used is the Access Northwind Database. With the connection string being placed in the web.config file.

1. Web Config File code:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <!--	|||||	Application Settings	|||||	-->
  <appSettings>
	<add key="strConn" value="Provider = Microsoft.Jet.OLEDB.4.0;Data Source=C:\Inetpub\wwwroot\Northwind.mdb;User ID=Admin;Password=;" />
  </appSettings>
  <system.web>
....
...

Authentication will be conducted by "forms" authentication set in the web.config file:

....
....
<!--  AUTHENTICATION 
          This section sets the authentication policies of the application. Possible modes are "Windows", 
          "Forms", "Passport" and "None"

          "None" No authentication is performed. 
          "Windows" IIS performs authentication (Basic, Digest, or Integrated Windows) according to 
           its settings for the application. Anonymous access must be disabled in IIS. 
          "Forms" You provide a custom form (Web page) for users to enter their credentials, and then 
           you authenticate them in your application. A user credential token is stored in a cookie.
          "Passport" Authentication is performed via a centralized authentication service provided
           by Microsoft that offers a single logon and core profile services for member sites.
    -->
    <!--	|||||	MY Authentication Setup	|||||	-->
    <authentication mode="Forms"> 
		<forms name="NWLogin" loginUrl="Login.aspx" />
	</authentication>

    <!--  AUTHORIZATION

3. Login Page Creationg (HTML Side), with form validation controls, using a summary display for an controls not passing validation.:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Login.aspx.vb" Inherits="NorthLogin.WebForm1"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
	<head>
		<title>Northwind Database Login</title>
		<meta content="Microsoft Visual Studio .NET 7.1" name="GENERATOR">
		<meta content="Visual Basic .NET 7.1" name="CODE_LANGUAGE">
		<meta content="JavaScript" name="vs_defaultClientScript">
		<meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
	</head>
	<body>
		<!-- |||||	Login Form	||||| -->
		<form id="frmlogin" method="post" runat="server">
			<asp:label id="lblMessage" runat="server" width="288px" font-bold="True" font-italic="True"
				font-size="Medium" forecolor="#C00000"></asp:label>
			<table id="mainTable" style="POSITION: absolute; TOP: 30%">
				<tr>
					<td>
						<table cellspacing="15" id="loginTable" style="BORDER-RIGHT: #6699cc solid; BORDER-TOP: #6699cc solid; FONT-WEIGHT: bold; LEFT: 30%; BORDER-LEFT: #6699cc solid; BORDER-BOTTOM: #6699cc solid; FONT-FAMILY: Sans-Serif; BACKGROUND-COLOR: lightgrey">
							<tr>
								<td><b>Login: </b>
								</td>
								<td>
									<asp:textbox id="txtUserName" runat="server" width="160px"></asp:textbox>
									<asp:requiredfieldvalidator runat="server" id="rvUserValidator" controltovalidate="txtUserName" errormessage="You must supply a Username!"
										display="None" />
								</td>
							</tr>
							<tr>
								<td><b>Password: </b>
								</td>
								<td>
									<asp:textbox id="txtPassword" runat="server" textmode="Password" width="160px"></asp:textbox>
									<asp:requiredfieldvalidator runat="server" id="rvPasswordValidator" controltovalidate="txtPassword" errormessage="Empty Passwords not accepted"
										display="None" />
								</td>
							</tr>
							<tr>
								<td align="center" colspan="2"><asp:button id="cmdSubmit" text="Submit" runat="server" borderstyle="Solid"></asp:button></td>
							</tr>
						</table>
					</td>
				</tr>
				<tr>
					<td>
						<table id="messageDisplay">
							<tr>
								<td><asp:validationsummary runat="server" displaymode="BulletList" id="Validationsummary1" width="472px" />
								</td>
							</tr>
						</table>
					</td>
				</tr>
			</table>
		</form>
		<!--	|||||	End of Form	|||||	-->
	</body>
</html>

4. The Code behind (in visual basic.net)

a. Imports:

Imports System.Web.Security '   |||||   Required Class for Authentication
Imports System.Data '   |||||   DB Accessing Import
Imports System.Data.OleDb   '   ||||||  Access Database Required Import!
Imports System.Configuration    '   ||||||  Required for Web.Config appSettings |||||

'   |||||   Connection String - XML coded in Web.Config
'   |||||   Remember to set the Security Settings in Windows on the MDB file for IUSR

b. Add the code for the button click event (in this case cmdSubmit button):

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '   |||||   Put user code to initialize the page here
    End Sub

    Private Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click
        If Page.IsValid Then
            '   |||||   Connect to Database for User Validation |||||
            If DBConnection(txtUserName.Text, txtPassword.Text) Then
                FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, False)  '   |||||   default.aspx Page!

            Else
                '   |||||   Credentials are Invalid
                lblMessage.Text = "Invalid Login!"
            End If
        End If
    End Sub

c. Write the code for the DBConnection Subroutine - Beginning with variable creation, and obtaining the connection string from web.config:

'   |||||   Declare Required Variables
        '   |||||   Access appSettings of Web.Config for Connection String (Constant)
        Dim LoginSQL As String
        Dim MyConn As OleDbConnection = New OleDbConnection(ConfigurationSettings.AppSettings("strConn"))

d. Withing DBConnection Subroutine :

'   |||||   Create a OleDb Command Object
'   |||||   Pass in the SQL String and Connection Object related to SQL String.
'   |||||   Passing in SQL string and Connection Obj to the OleDbCommand Constructor
'   |||||   Pass in Stored procedure
'   |||||   Set CommandType to Stored Procedure
Dim MyCmd As New OleDbCommand("sp_ValidateUser", MyConn)
MyCmd.CommandType = CommandType.StoredProcedure

'   |||||   Create Parameter Objects for values passed in
Dim objParam1, objParam2 As OleDbParameter

***Note*** The SQL Stored Procedure in Access is :

SELECT Count(*) as Num_of_Users FROM tblUsers WHERE u_Name = @UserName AND u_Password = @Password;

Continue in DBConnection Subroutine :

'   |||||   Add the parameters to the parameters collection of the
'   |||||   command object, and set their datatypes (OleDbType in this case)
objParam1 = MyCmd.Parameters.Add("@UserName", OleDbType.Char)
objParam2 = MyCmd.Parameters.Add("@Password", OleDbType.Char)
'   |||||   Set the direction of the parameters...input, output, etc
objParam1.Direction = ParameterDirection.Input
objParam2.Direction = ParameterDirection.Input
'   |||||   Set the value(s) of the parameters to the respective source controls
objParam1.Value = txtUserName.Text
objParam2.Value = txtPassword.Text

'   |||||   Try, catch block!
    Try
       '   |||||   Check if Connection to DB is already open, if not, then open    a      connection
        If MyConn.State = ConnectionState.Closed Then
        '   |||||   DB not already Open...so open it
            MyConn.Open()
        End If

        '   |||||   Create OleDb Data Reader
        Dim objReader As OleDbDataReader
        objReader = MyCmd.ExecuteReader(CommandBehavior.CloseConnection)
        '   |||||   Close the Reader and the Connection Closes with it

        While objReader.Read()
           If CStr(objReader.GetValue(0)) <> "1" Then
               lblMessage.Text = "Invalid Login!"
           Else
               objReader.Close()   '   |||||   Close the Connections & Reader
               Return True
           End If

        End While
   Catch ex As Exception
            lblMessage.Text = "Error Connecting to Database!"
   End Try


End Function

Voila, compile and run. Hopefully the comments in and outside of the code give you enough of an idea on how to customize this code for your needs.

Happy coding folks! :lol:

Member Avatar
Slade
Practically a Master Poster
631 posts since Mar 2004
Reputation Points: 66 [?]
Q&As Helped to Solve: 7 [?]
Skill Endorsements: 0 [?]
 
0
 

Once again Paladine buddy, you've done a great job. Congrats man, good code.

Member Avatar
Paladine
Master Poster
812 posts since Feb 2003
Reputation Points: 138 [?]
Q&As Helped to Solve: 28 [?]
Skill Endorsements: 5 [?]
Team Colleague
 
0
 

Thanks Slade. I just hope someone can put the code to good use.

I plan to upgrade this code to a moderate level of knowledge, by creating a Login User Customizable control that can be dropped into any page where it is needed. But that won't be a few weeks at least.

Member Avatar
Tekmaven
Software Architect
937 posts since Feb 2002
Reputation Points: 258 [?]
Q&As Helped to Solve: 29 [?]
Skill Endorsements: 27 [?]
Team Colleague
 
0
 

Just a reminder to the new ASP.NET Programmers: your web.config file is case-sensitive, so be careful copying the text :).

Member Avatar
Paladine
Master Poster
812 posts since Feb 2003
Reputation Points: 138 [?]
Q&As Helped to Solve: 28 [?]
Skill Endorsements: 5 [?]
Team Colleague
 
0
 

A small addition to this code, which will allow the application to monitor the number of attempts at a login before granting or denying access.

a. Modify the Global.asax Session_Start method:

Sub Session_Start(ByVal sender As Object, ByVal e As EventArgs)
        '<summary>
        '   |Fires when the session is started
        '   |Administrator will only be allowed a certain number of login attempts
        '</summary>
        Session("Num_of_Tries") = 3
        Session("LoginCount") = 0

        '   |Track whether they're logged in or not
        Session("Logged_IN") = "No"
End Sub

b. Add the code for the button click event (in this case cmdSubmit button): - Revised!

Private Sub cmdSubmit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click
        If Page.IsValid Then    '   ||||| Meaning the Control Validation was successful!
            '   |||||   Connect to Database for User Validation |||||
            Dim intMaxLoginAttempts = CInt(Session("Num_of_Tries"))

            If DBConnection(txtUserName.Text.Trim(), txtPassword.Text.Trim()) Then
                Session("Logged_IN") = "Yes"    '   |||||   Use to Validate on other pages in the application
                FormsAuthentication.RedirectFromLoginPage(txtUserName.Text, False)  '   |||||   default.aspx Page!
            Else
                '   |||||   Credentials are Invalid
                lblMessage.Text = "Invalid Login!"
                '   |||||   Increment the LoginCount (attempts)
                Session("LoginCount") = CInt(Session("LoginCount")) + 1
                '   |||||   Determine the Number of Tries
                If Session("LoginCount").Equals(intMaxLoginAttempts) Then
                    Response.Redirect("Denied.aspx")
                End If

            End If
        End If
End Sub

c. Validate login on other pages in the application - Add to Page_Load Event

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        '   <summary>
        '   |||||   Authenicate user for accces to pages within application
        '   |||||   Enusre the page can't be navigated to without
        '   |||||   user's being online and logged in.
        '   |||||   **Note: Logged_IN session object is created in Session_Start 
        '   |||||   of the Global.asax file **
        '   </summary>

        '   |Do not allow caching of page
        Response.Cache.SetCacheability(HttpCacheability.NoCache)
        If Session("Logged_IN").Equals("No") Then
            Response.Redirect("Login.aspx")
        End If

Happy coding :cool: !

Member Avatar
JasonRCS
Newbie Poster
13 posts since Jul 2004
Reputation Points: 3 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

I am new to stored procedures in Access, infact I have been told that it could not be done. I have tried to create a query in sql view and named it sp_Check User, but I get an error that my app can not access the table or querry.

How do I create a stored procedure in Access?

Thanks,

Member Avatar
Paladine
Master Poster
812 posts since Feb 2003
Reputation Points: 138 [?]
Q&As Helped to Solve: 28 [?]
Skill Endorsements: 5 [?]
Team Colleague
 
0
 

Hi JasonRCS, I think I can help. Whom ever told you that Stored Procedures can not be done in access was completely wrong...well ok, maybe just a little wrong. Granted they look nothing like those done on SQL server, but they do function the same way.

In the above exercise this is the stored "procedure" I used.

SELECT COUNT(*) AS Num_of_User
FROM tblUser
WHERE (((tblUser.U_Name)=[@UserName]) AND ((tblUser.U_Password)=[@Password]));

That is exactly how it appears in the SQL view in Access. See here is why the person who said it wasn't possible was partly right. :cool: As you don't really use the Create Procedure syntax as you would in SQL Server. But the principle is still the same.

Hope this helps.

Member Avatar
curiosity5
Newbie Poster
4 posts since Sep 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

I'm a newbie. I have 8 years of access experience and had enough of it.
Can anyone put this code together in a folder in the correct files for me or at least tell me which codes go into which files? I just couldn't get it working.
Thanks in advance. :sad:

Member Avatar
curiosity5
Newbie Poster
4 posts since Sep 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

I attached the two files.
I just renamed them to .txt for attachment.
I have login.aspx and web.config in a folder. It stopped at
Line 1: <%@ Page Language="vb" AutoEventWireup="false" Codebehind="Login.aspx.vb" Inherits="NorthLogin.WebForm1"%>

Please help!!

Attachments login.txt (5.82KB) web.txt (0.47KB)
Member Avatar
curiosity5
Newbie Poster
4 posts since Sep 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

oh wait, i know what i did wrong. Let me try this again.

Member Avatar
curiosity5
Newbie Poster
4 posts since Sep 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Ok i give up.
I'm using visual.net.
Please help!!

Member Avatar
Paladine
Master Poster
812 posts since Feb 2003
Reputation Points: 138 [?]
Q&As Helped to Solve: 28 [?]
Skill Endorsements: 5 [?]
Team Colleague
 
0
 

Ok, several people have replied to this (both here and on private messages) about having difficulty with this code. Remember this is only a guide!

But for the sake of simplicity, I will post the files associated with this snippet!

Login_HTML.aspx.txt (2.2 KB) - The Login.aspx Web Form HTML
Login_VBNET.aspx.vb.txt (6.0 KB) - The Login.aspx.vb Web Form Code behind (VB.Net)
Web.Config.txt (6.2 KB) - The Web.Config I used
Northwind.zip (409.6 KB) - Northwind Database with Login Table and Stored Procedure.

Hope this helps!

Attachments Login_HTML.aspx_.txt (2.21KB) Login_VBNET.aspx_.vb_.txt (5.96KB) Web.Config_.txt (6.25KB) Northwind.zip (409.58KB)
Member Avatar
woden
Newbie Poster
1 post since Oct 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
-1
 

please help me, i have problems

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: File or assembly name CrystalDecisions.CrystalReports.Engine, or one of its dependencies, was not found.

Source Error:


Line 14: debugging ASP.NET files.
Line 15: -->
Line 16: <compilation defaultLanguage="vb" debug="true"><assemblies><add assembly="CrystalDecisions.CrystalReports.Engine, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.ReportSource, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Shared, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Web, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></assemblies></compilation>
Line 17:
Line 18: <!-- CUSTOM ERROR MESSAGES


what can i do?

Member Avatar
Paladine
Master Poster
812 posts since Feb 2003
Reputation Points: 138 [?]
Q&As Helped to Solve: 28 [?]
Skill Endorsements: 5 [?]
Team Colleague
 
0
 

please help me, i have problems

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately.

Parser Error Message: File or assembly name CrystalDecisions.CrystalReports.Engine, or one of its dependencies, was not found.

Source Error:


Line 14: debugging ASP.NET files.
Line 15: -->
Line 16: <compilation defaultLanguage="vb" debug="true"><assemblies><add assembly="CrystalDecisions.CrystalReports.Engine, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.ReportSource, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Shared, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/><add assembly="CrystalDecisions.Web, Version=9.1.5000.0, Culture=neutral, PublicKeyToken=692fbea5521e1304"/></assemblies></compilation>
Line 17:
Line 18: <!-- CUSTOM ERROR MESSAGES


what can i do?

OK thanks for posting the error message, but that helps little when you are not providing a description of what you were doing or trying to do?

When do you get this error message? For this login? I don't think so, as Crystal Decisions is used for generating reports, not a login.

Please provide more details, files involved, and maybe then I can help.

Member Avatar
arsenal
Newbie Poster
1 post since Dec 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Can i get a sample of login page using SQL Server 2000 but not Access????
because i do not know how to change the code by using SQL Server 2000

Hope can help me...

it's urgent

thanks a lot

Member Avatar
Paladine
Master Poster
812 posts since Feb 2003
Reputation Points: 138 [?]
Q&As Helped to Solve: 28 [?]
Skill Endorsements: 5 [?]
Team Colleague
 
0
 

Can i get a sample of login page using SQL Server 2000 but not Access????
because i do not know how to change the code by using SQL Server 2000

Hope can help me...

it's urgent

thanks a lot

OK, this shouldn't be too hard to piece together from the basic structure I have provided above. But since you are not the first person to ask me about this I feel I should provide some of the changes that need to be made to the code to use SQL Server.

Ok remember that you require the creation of a connection object inorder to access the SQL Database. The basics for the connection string (the means of creating this connection object) is;


Imports System.Data.SqlClient
...
Dim oSQLConn As SqlConnection = New SqlConnection()
oSQLConn.ConnectionString = "Data Source=(local);" & _
"Initial Catalog=myDatabaseName;" & _
"Integrated Security=SSPI"
oSQLConn.Open()

or if you are using a remote server this is the basic structure:

(via IP address):

oSQLConn.ConnectionString = "Network Library=DBMSSOCN;" & _
"Data Source=xxx.xxx.xxx.xxx,1433;" & _
"Initial Catalog=myDatabaseName;" & _
"User ID=myUsername;" & _
"Pas sword=myPassword"

But I will show below the changes you could do to the above code and still use the Web.Config file (much more secure).

New Web.Config (partial code only, not the whole file)

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <!--	|||||	Application Settings	|||||	-->
  <appSettings>
	<add key="strConn" value="Provider=SQLOLEDB;Data Source=(local);Initial Catalog=Northwind;Integrated Security=SSPI;"/>
  </appSettings>
  <system.web>

The updated heading to all ASP.Net Page Code Behinds (still using VB.Net):

Imports System.Web.Security '   |||||   Required Class for Authentication
Imports System.Data '   |||||   DB Accessing Import
'   || The following two IMPORTS are for Access DB & SQL Server DB Respectively
'   Imports System.Data.OleDb   '   ||||||  Access Database Required Import!
Imports System.Data.SqlClient
Imports System.Configuration    '   ||||||  Required for Web.Config appSettings |||||

Changes needed to create an SQL Connection Object:

'   |||||   First is the Connection Object for an Access DB
        'Dim MyConn As OleDbConnection = New OleDbConnection(ConfigurationSettings.AppSettings("strConn"))
        '   |||||   This is the Connections Object for an SQL DB
        Dim MyConn As SqlConnection = New SqlConnection(ConfigurationSettings.AppSettings("strConn"))

[/b]

Changes to the code for SQL Command Object creation:

'   |||||   To Access a Stored Procedure in Access - Requires a Command Object
        'Dim MyCmd As New OleDbCommand("sp_ValidateUser", MyConn)
        '   |||||   To Access a Stored Procedure in SQL Server - Requires a Command Object
        Dim MyCmd As New SqlCommand("sp_ValidateUser", MyConn)

Now there is other parts of the code you have to change, but from the few I have already done it should be fairly easy to know what other changes need to be made. Those could/would include but not limited to: OleDBParamater Object, OleDbType.Char (this would be SqlDbType.Char ? ), and the OleDbDataReader object to name a few!

Hope this helps, and happy coding!

:cool:

Member Avatar
urbanXroadsjr
Newbie Poster
1 post since Dec 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Don't worry I'm in the same boat as you in using SQL Server, When I figure it out I'll let you know. I'm a novice to ASP.NET also.

Member Avatar
Sulley's Boo
Posting Pro in Training
450 posts since Dec 2004
Reputation Points: 490 [?]
Q&As Helped to Solve: 20 [?]
Skill Endorsements: 2 [?]
 
0
 


ammm .. is this what i want? .. amm .. :-|

i am using MS Access as the backend for my website .. and VB .NET as the front end ..

do i have to type in alllllll that code for the login thing? ..

i mean only registered members can log in .. how can i do that? .. the registeration thingy is working .. :cool: ..

:( ..

Member Avatar
Javaknight
Newbie Poster
10 posts since Dec 2004
Reputation Points: 0 [?]
Q&As Helped to Solve: 1 [?]
Skill Endorsements: 0 [?]
 
0
 

Now there is other parts of the code you have to change, but from the few I have already done it should be fairly easy to know what other changes need to be made. Those could/would include but not limited to: OleDBParamater Object, OleDbType.Char (this would be SqlDbType.Char ? ), and the OleDbDataReader object to name a few!

Experts,

This code has been a very good introduction for me to learn the .Net environment. :D I am currently porting/translating an application done in traditional ASP into .Net. However, I am experiencing difficulties using the login example here as a guide. While the page comes up with no errors and the validators work I am having trouble making the application send the user to a different page. (OK I am VERY new to programming in ASP.NET. :o ) I am trying to determine whether the problem is in my code or in the Stored Procedure that I created :?: ; Since the system is not giving me an error message, I am kind of in a quandary. :sad:

This is the code for my Stored Procedure (I have changed some of the elements in the example because of some of the application logic.):

CREATE PROCEDURE dbo.ws_ValidateUser
(@wisUser nVarChar(50),
@wisUserPass nVarChar(50))
AS
SELECT
Count(*) as Num_of_Users
FROM
Dbo.Users
WHERE loginName = @wisUser AND Password = @wisUserPass
GO

Does anyone know SQL Server well enough to tell me if there is a problem in this procedure :?: (I believe I have been consistent in my use of the variable and field names throughout the application, that are different from the original example by Paladine.) Do I need to provide some of the code as well :?:

Member Avatar
Paladine
Master Poster
812 posts since Feb 2003
Reputation Points: 138 [?]
Q&As Helped to Solve: 28 [?]
Skill Endorsements: 5 [?]
Team Colleague
 
0
 

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.

You
This question has already been solved: Start a new discussion instead
Post:
Start New Discussion
Tags Related to this Article