click twice in order to logon???

newbeee

Member
Joined
Sep 27, 2007
Messages
19
Programming Experience
Beginner
I have a typical logon page that prompt for username & password.

VB.NET:
    Public ReadOnly Property getUserName() As String
        Get
            getUserName = txtUserName.Text & " "
        End Get
    End Property

    Public ReadOnly Property getPassword() As String
        Get
            getPassword = txtPassword.Text & " "
        End Get
    End Property
    Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs)
        Dim rpData As New clsACData
        Dim isConnect As Boolean = False

        If Not (getUserName = " " And getPassword = " ") Then
            isConnect = rpData.Logon(getUserName, getPassword)

            If (isConnect = True) Then
                btnLogin.PostBackUrl = "~/Start.aspx"
            Else
                lblError.Visible = True
                lblError.Text = "Please enter right combination of username and password"
            End If

        End If
    End Sub
and a function in class data that varify logon info:

VB.NET:
Public Function Logon(ByVal uName As String, ByVal uPass As String) As Boolean
        Dim vConnect As Boolean = False
        Dim temprp As New Metafile.ResultsPlus.Results

        If temprp.Initialize(uName, uPass, rpServer, rpDatabase, Metafile.ResultsPlus.Results.RpDBType.ESqlServer, _
        sqlUID, sqlPWD, 30, rpPort) Then
            vConnect = True
        End If

        Logon = vConnect
          
    End Function
It's fairly straight forward & seems to work. However, after I put in the password & hit logon button, the password is clear out. Then I put in the password again & hit the logon button, it let me in. How strange? Am I missing something? I'm fairly new...not so sure where I'm heading off :)
 
Last edited by a moderator:
Back
Top