[Resolved] How to get Drop down List box selected value
Heres my code behind. The code executes but doesnt read the selected values it just picks the first values in the list.
VB Code:
Private Sub btnGo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGo.Click
Me.SqlSelectCommand1.Parameters.Item("@User").Value = Session("MyID")
Me.SqlSelectCommand1.Parameters.Item("@start").Value = Me.txtstart.Text
Me.SqlSelectCommand1.Parameters.Item("@end").Value = Me.txtend.Text
Me.SqlSelectCommand1.Parameters.Item("@status").Value = Me.dlststatus.SelectedValue
Me.SqlSelectCommand1.Parameters.Item("@type").Value = Me.dlstType.SelectedValue
SqlDataAdapter1.Fill(DataSet11)
Repeater1.DataSource = DataSet11
Repeater1.DataBind()
End Sub
Heres my HTML for the controls. Although not shown here they are within the form tags.
VB Code:
<asp:label id="lblStatus" runat="server" Width="64px">Status</asp:label><asp:dropdownlist id=dlststatus runat="server" Width="88px" DataSource="<%# DsStatus1 %>" DataTextField="Status" DataMember="TBL_LK_Status" DataValueField="Status"></asp:dropdownlist><br>
<asp:label id="lblType" runat="server" Height="16px" Width="64px">Type</asp:label><asp:dropdownlist id=dlstType runat="server" DataSource="<%# DsJobTypes1 %>" DataTextField="JobType" DataMember="TBL_LK_JobTypes" DataValueField="JobType"></asp:dropdownlist><br>
<asp:button id="btnGo" runat="server" Width="48px" Text="Go"></asp:button></div>
Re: How to get Drop down List box selected value
Same problem as Selected Index changed (If not IsPostBack Then)