You can SelectedValue of Dropdownlist.

Dim str as String
str= DropDownlist1.SelectedValue


Thanks for the reply but that gives the text not the key value,so i created a hash table and got the value pair like this,

If Not Page.IsPostBack Then
            get_data.execute_Sql("SELECT CCODE,COMPANY_NAME FROM COMPANY")

            While get_data.dr.Read
                arrData.Add(get_data.dr.Item(0), get_data.dr.Item(1))
            End While

            With cboCompany
                .DataSource = arrData
                .DataValueField = "key"
                .DataTextField = "value"
            End With
        End If


Thanks for the reply...


Edited 7 Years Ago by __avd: Add [code] tags. Encase your code in: [code] and [/code] tags.

This question has already been answered. Start a new discussion instead.