Problems with Dropdown list and selected value

  • Thread starter Thread starter Stewart Saathoff
  • Start date Start date
S

Stewart Saathoff

Hey,

I have a problem with a drop-down list. When I load the web form, the
dropdown list display's a set of all the employee's that is in the database.
If I set a breakpoint in the code and click the Login Button, the selected
text that appears is always the first one in the dataset. Does anyone know
why or has any idea on how to correct this?

Thanks,.

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
Dim ws As New tcservice
Dsusers1.Merge(ws.GetEmployees)
Me.ddlemployee.DataBind()
End Sub


Private Sub btnLogin_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnLogin.Click
Dim u As String
Dim p As String
Session("user") = ""
Session("pass") = ""
u = Me.ddlemployee.SelectedItem.Text
p = Me.password.Text
Session("user") = u
Session("pass") = p
End Sub
 
And yes, I am selecting a different item before I click the login button...
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top