Results 1 to 2 of 2

Thread: [Resolved] How to get Drop down List box selected value

  1. #1

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Resolved [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:
    1. Private Sub btnGo_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnGo.Click
    2.         Me.SqlSelectCommand1.Parameters.Item("@User").Value = Session("MyID")
    3.         Me.SqlSelectCommand1.Parameters.Item("@start").Value = Me.txtstart.Text
    4.         Me.SqlSelectCommand1.Parameters.Item("@end").Value = Me.txtend.Text
    5.         Me.SqlSelectCommand1.Parameters.Item("@status").Value = Me.dlststatus.SelectedValue
    6.         Me.SqlSelectCommand1.Parameters.Item("@type").Value = Me.dlstType.SelectedValue
    7.  
    8.         SqlDataAdapter1.Fill(DataSet11)
    9.         Repeater1.DataSource = DataSet11
    10.         Repeater1.DataBind()
    11.     End Sub
    Heres my HTML for the controls. Although not shown here they are within the form tags.
    VB Code:
    1. <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>
    2.                             <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>
    3.                             <asp:button id="btnGo" runat="server" Width="48px" Text="Go"></asp:button></div>
    Last edited by FishGuy; May 10th, 2005 at 05:21 AM. Reason: Resolved

  2. #2

    Thread Starter
    Frenzied Member FishGuy's Avatar
    Join Date
    Mar 2005
    Location
    Bradford UK
    Posts
    1,708

    Re: How to get Drop down List box selected value

    Same problem as Selected Index changed (If not IsPostBack Then)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width