textbox help webforms

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a web form that has a textbox that receives a password. Upon leaving
the txtbox the user name and password queries the table in
objoledbcommand.connection to determine if correct password has been entered.
If correct password then many buttons have visible = true. problem is i can
not find leave method, lostfocus method, onblur, onlostfocus anywhere to
place this code to make this happen. I am pulling out my hair and not
pleased with other newsgroups solutions (too extensive of code). Thanks for
the help. I have spent a whole day on this and am getting no where fast.
 
If you are looking for these methods on the server, then you aren't going to
find them.

Focus and blur events can only take place in the browser on the client's
machine. Hence, you can only handle them there.

You will need to write javascript event handlers, and hook them up to the
appropriate input controls.
 
"write javascript event handlers and hook them up" -- new to .net and have
written a lot of vb6 but little javascript. I need some specific help for
this activity. Secondly I put a button on the aspx page and put following
code click event;

Dim drhasrows As Boolean = False
strsql = "select fullname, password from employees where fullname =
'" & DropDownList1.SelectedValue & "' and password = '" &
txtTimeClockPassword.Text & "'"
objoledbcommand.CommandText = strsql
objoledbdatareader = objoledbcommand.ExecuteReader
drhasrows = objoledbdatareader.HasRows
If drhasrows Then
lblGreeting.Visible = True
btnLogIn.Visible = True
btnLogOut.Visible = True
btnViewLog.Visible = True
btnChangePswd.Visible = True
btnEmployees.Visible = True
btnReports.Visible = True
Else
lblGreeting.Visible = False
btnLogIn.Visible = False
btnLogOut.Visible = False
btnViewLog.Visible = False
btnChangePswd.Visible = False
btnEmployees.Visible = False
btnReports.Visible = False
MsgBox("Password does not match User. Please re-enter
password or consult with system admin.")
End If

when i run the button does not run the above code. Why? thanks for help
 
Back
Top