CatManDave
MIS
Guys,
I am muddling my way thru .NET so this may seem like a very basic question.
I have a DDL populated by a SQL table and I set the selected value based on a passed parameter. This seems to work fine and actually displays the correct value...
Private Sub Page_Load(blah, blah, blah)
'Schedule Type drop down box
SchTypeDDL.SelectedItem.Text = schedID
SchTypeDDL.SelectedItem.Value = schedID
cmd = New SqlCommand( _
"SELECT * FROM PhyCodes " _
& "WHERE codetype = " & "'" & "ST" & "' " _
& "ORDER BY code", cnn)
cnn.Open()
rdr = cmd.ExecuteReader CommandBehavior.CloseConnection)
While rdr.Read
SchTypeDDL.Items.Add(New ListItem(rdr("code")))
End While
rdr.Close()
end sub
Once I change the drop down box selection and click a submit button, I simply want to retrieve it for a table update.
Private Sub Submit_Click(blah, blah, blah)
dim schedID as string
schedID = SchTypeDDL.SelectedValue
end sub
This always returns the original selected value and not the new selected value.
As I said I'm new to .NET. Can anyone spot the bonehead move I am making. THis is so simple in ASP classic that I can't believe I cannot get this to work.
Thanks in advance,
Dave
I am muddling my way thru .NET so this may seem like a very basic question.
I have a DDL populated by a SQL table and I set the selected value based on a passed parameter. This seems to work fine and actually displays the correct value...
Private Sub Page_Load(blah, blah, blah)
'Schedule Type drop down box
SchTypeDDL.SelectedItem.Text = schedID
SchTypeDDL.SelectedItem.Value = schedID
cmd = New SqlCommand( _
"SELECT * FROM PhyCodes " _
& "WHERE codetype = " & "'" & "ST" & "' " _
& "ORDER BY code", cnn)
cnn.Open()
rdr = cmd.ExecuteReader CommandBehavior.CloseConnection)
While rdr.Read
SchTypeDDL.Items.Add(New ListItem(rdr("code")))
End While
rdr.Close()
end sub
Once I change the drop down box selection and click a submit button, I simply want to retrieve it for a table update.
Private Sub Submit_Click(blah, blah, blah)
dim schedID as string
schedID = SchTypeDDL.SelectedValue
end sub
This always returns the original selected value and not the new selected value.
As I said I'm new to .NET. Can anyone spot the bonehead move I am making. THis is so simple in ASP classic that I can't believe I cannot get this to work.
Thanks in advance,
Dave