D
Dan
Hi,
I create 5 dropdownlist in code-behind. I want to insert their
selectedvalues in a table by making a string separated with ":"
I can get their selecedvalues but i'm stuck when i want to execute the
insert.
The error is "name dd is not declared" (in line: selvalue = selvalue &
Session("dd" & dd.id) & ":"
Any idea how to solve this?
Thanks for help
Dan
Dim dd() As DropDownList
Dim i As Integer
for i= 1 to 5
dd(i) = New DropDownList
dd(i).ID = id 'can be anything
next
For Each d As DropDownList In dds
AddHandler d.SelectedIndexChanged, AddressOf dropd
Next
Protected Sub dropd(ByVal sender As Object, ByVal e As System.EventArgs)
Dim dd As DropDownList = CType(sender, DropDownList)
Session("dd" & id) = dd.SelectedValue
End Sub
Protected Sub submit_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim i As Integer
Dim selvalue As String
For i = 1 To 5
selvalue = selvalue & Session("dd" & dd.id) & ":"
Next
sql="insert ....."
....
I create 5 dropdownlist in code-behind. I want to insert their
selectedvalues in a table by making a string separated with ":"
I can get their selecedvalues but i'm stuck when i want to execute the
insert.
The error is "name dd is not declared" (in line: selvalue = selvalue &
Session("dd" & dd.id) & ":"
Any idea how to solve this?
Thanks for help
Dan
Dim dd() As DropDownList
Dim i As Integer
for i= 1 to 5
dd(i) = New DropDownList
dd(i).ID = id 'can be anything
next
For Each d As DropDownList In dds
AddHandler d.SelectedIndexChanged, AddressOf dropd
Next
Protected Sub dropd(ByVal sender As Object, ByVal e As System.EventArgs)
Dim dd As DropDownList = CType(sender, DropDownList)
Session("dd" & id) = dd.SelectedValue
End Sub
Protected Sub submit_Click(ByVal sender As Object, ByVal e As
System.EventArgs)
Dim i As Integer
Dim selvalue As String
For i = 1 To 5
selvalue = selvalue & Session("dd" & dd.id) & ":"
Next
sql="insert ....."
....