Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
DropDownList1.Items.Add(New ListItem(" ", 0))
DropDownList1.Items.Add(New ListItem("Steve", 1))
DropDownList1.Items.Add(New ListItem("Rebee", 2))
DropDownList1.Items.Add(New ListItem("Daisy", 3))
End If
End Sub
Protected Sub cmdSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles cmdSubmit.Click
Response.Write("Text=" & DropDownList1.Items(DropDownList1.SelectedIndex).Text & " Value=" & DropDownList1.Items(DropDownList1.SelectedIndex).Value)
End Sub