Hello,
Our lead (and only other) developer abruptly quit and I have been left to maintain his code. I brought down a copy of the code directly from the production web server, where everything works perfectly. I'm running on Visual Studio 2008, when I open the code it compiles cleanly; however, when I try to run it, the code is failing on our login screen when trying to verify my credentials. I have attached the code below -- basically it is dropping into the function btnLogon_Click, and from there trying to access a .dll function - memb.ValidateStateStaffAD, failing, and moving straight to my catch statement. I have verified that these are the same .dlls that are being used in production, and I'm not sure what's happening that is making it jump to the catch statement.
Any help would be greatly appreciated, I've been simply trying to get this site up and running on my pc since Monday morning and have exhausted everything I know to do. If you need any more detail, I'll provide whatever I can...
Our lead (and only other) developer abruptly quit and I have been left to maintain his code. I brought down a copy of the code directly from the production web server, where everything works perfectly. I'm running on Visual Studio 2008, when I open the code it compiles cleanly; however, when I try to run it, the code is failing on our login screen when trying to verify my credentials. I have attached the code below -- basically it is dropping into the function btnLogon_Click, and from there trying to access a .dll function - memb.ValidateStateStaffAD, failing, and moving straight to my catch statement. I have verified that these are the same .dlls that are being used in production, and I'm not sure what's happening that is making it jump to the catch statement.
Any help would be greatly appreciated, I've been simply trying to get this site up and running on my pc since Monday morning and have exhausted everything I know to do. If you need any more detail, I'll provide whatever I can...
VB.NET:
Imports System.Data.SqlClient
Imports System.Web.Security
Imports System.Web.Mail
Namespace AssessmentTest
Partial Class ResearchLogin
Inherits System.Web.UI.UserControl
Protected thing As New commonCode
#Region " Web Form Designer Generated Code "
'This call is required by the Web Form Designer.
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
End Sub
Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
'CODEGEN: This method call is required by the Web Form Designer
'Do not modify it using the code editor.
InitializeComponent()
End Sub
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
txtPassword.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnLogon.UniqueID + "').click();return false;}} else {return true}; ")
txtUserName.Attributes.Add("onkeydown", "if(event.which || event.keyCode){if ((event.which == 13) || (event.keyCode == 13)) {document.getElementById('" + btnLogon.UniqueID + "').click();return false;}} else {return true}; ")
Page.ClientScript.RegisterStartupScript(Me.GetType(), "SetInitialFocus", "<script>document.getElementById('" & txtUserName.ClientID & "').focus();</script>")
End Sub
Public Event LoginAction(ByVal sender As Object, ByVal e As EventArgs, ByVal username As String, ByVal passwordverified As Boolean)
Private Sub btnLogon_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLogon.Click
Dim domain As String = "Jefferson"
Dim memb As JCPS.Common.Security.MembershipManager = CType(Membership.Provider, JCPS.Common.Security.MembershipManager)
Dim passwordVerified As Boolean = False
Try
If (memb.ValidateStateStaffAD(txtUserName.Text, txtPassword.Text, domain)) Then
lblMessage.ForeColor = Drawing.Color.Green
lblMessage.Text = "Succeed"
passwordVerified = True
End If
If passwordVerified = False Then
Dim username As String
username = Trim(txtUserName.Text.ToLower)
Try
passwordVerified = VerifyPassword(username, txtPassword.Text.ToLower)
Catch ex As Exception
lblMessage.Text = "Your UserName is incorrect or your account is inactive. " & ex.Message & " " & username
Return
End Try
If passwordVerified Then
RaiseEvent LoginAction(sender, e, username, passwordVerified)
Else
lblMessage.Text = "Invalid password - Try again or use the 'Forgot Password' link to have it reset."
End If
Else
lblMessage.ForeColor = Drawing.Color.Red
lblMessage.Text = "Failed"
End If
If passwordVerified Then
RaiseEvent LoginAction(sender, e, txtUserName.Text, passwordVerified)
End If
Catch ex As Exception
Throw New Exception("Exception Logging Forgotten Pass. " + ex.InnerException.Message)
End Try
End Sub