All,
Below is what I have and when I click submit button I got the error "Cannot have multiple items selected in a DropDownList" Any help is appreciated.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Session("myTable") = New Data.DataView()
ddApp.Items.Add(New ListItem("--- Please Select ---"))
ddApp.Items.Add(New ListItem("ABC"))
ddApp.Items.Add(New ListItem("DEF"))
ddApp.Items.Add(New ListItem("GHI"))
Dim i As Integer
For i = 1 To 10
ddNum.Items.Add(New ListItem(i))
ddNum.SelectedIndex = 0
Next i
End If
End Sub
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
cmdInsert.Parameters.AddWithValue("@name", ddApp.SelectedItem.Text)
cmdInsert.Parameters.AddWithValue("@copy_num", ddNum.SelectedItem.Text)
end sub
Below is what I have and when I click submit button I got the error "Cannot have multiple items selected in a DropDownList" Any help is appreciated.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
If Not Page.IsPostBack Then
Session("myTable") = New Data.DataView()
ddApp.Items.Add(New ListItem("--- Please Select ---"))
ddApp.Items.Add(New ListItem("ABC"))
ddApp.Items.Add(New ListItem("DEF"))
ddApp.Items.Add(New ListItem("GHI"))
Dim i As Integer
For i = 1 To 10
ddNum.Items.Add(New ListItem(i))
ddNum.SelectedIndex = 0
Next i
End If
End Sub
Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
cmdInsert.Parameters.AddWithValue("@name", ddApp.SelectedItem.Text)
cmdInsert.Parameters.AddWithValue("@copy_num", ddNum.SelectedItem.Text)
end sub