diff --git a/login/ForgotPW.aspx.vb b/login/ForgotPW.aspx.vb index fef512b..90541fd 100644 --- a/login/ForgotPW.aspx.vb +++ b/login/ForgotPW.aspx.vb @@ -13,21 +13,27 @@ Partial Class login_ForgotPW End Sub Protected Sub btn_Send_Click(sender As Object, e As EventArgs) - Dim username As String = txt_Username.Text + Dim username As String = String.Empty Dim password As String = String.Empty Dim email As String = String.Empty Dim tokenname As String = String.Empty valreqtxtEmail.Validate() check_UserName_regex.Validate() - If valreqtxtEmail.IsValid = True Then + If valreqtxtEmail.IsValid = True AndAlso check_UserName_regex.IsValid = True Then email = txtEmail.Text + username = txt_Username.Text ElseIf valreqtxtEmail.IsValid = False Then valreqtxtEmail.ErrorMessage = "Annotation: The given Domain is not the company domain." regexval_txt_Email.Validate() valreqtxtEmail.IsValid = True + If check_UserName_regex.IsValid = False Then + check_UserName_regex.ErrorMessage = "Annotation: The Username does not match the requirements." + Else + check_UserName_regex.IsValid = True + End If End If - If String.IsNullOrEmpty(email) = False AndAlso String.IsNullOrEmpty(tokenname) = True AndAlso String.IsNullOrEmpty(password) = True AndAlso String.IsNullOrEmpty(username) = False Then + If String.IsNullOrEmpty(email) = False AndAlso String.IsNullOrEmpty(tokenname) = True AndAlso String.IsNullOrEmpty(password) = True AndAlso String.IsNullOrEmpty(username) = False Then Dim ConnectionString = String.Empty If HttpContext.Current.Request.ServerVariables("SERVER_NAME") = "localhost" Then 'ConnectionString = "Server=DEVELOPER\DEVSQL;Database=VERAG_HOMEPAGE;Uid=sa;Pwd=BmWr501956" @@ -118,7 +124,6 @@ Partial Class login_ForgotPW ElseIf String.IsNullOrWhiteSpace(password) = True Then lblMessage.Text = "An internal password searching error occured in our systems ." End If - End If Else 'MsgBox("The form has not been filled completeley.", MsgBoxStyle.Critical, "Error08")