Last post May 21, 2008 09:42 AM by tartuffe2
May 20, 2008 05:35 PM|tartuffe2|LINK
May 21, 2008 03:07 AM|Chetan Chopade|LINK
You have used dd(i)=New DropDownList
For i=1 To 5
selvalue=selvalue & Session("dd" & dd(i).ID) & ":"
May 21, 2008 09:42 AM|tartuffe2|LINK
Thanks for replying.
I think my explanation was not good enough. I ommitted some code to restrict the message.
This is the real problem: there are a unknown number of dropdownlist (questions of a survey) (i took 5 as example) depending of the user who create the questions. The dropdownlists (some are not visible) have the property AutoPostBack = true, because the value
of dropdownlist x can make another further
dropdownlist visible. So each time an user introduces a value, the depending
DD will be visible or remains unvisible. This is solved.
Now, i want to collect all the selectedvalues and put them into a table. But i can't find a way to pass the collected selectedvalues in the submit
Friend dds As New List(Of DropDownList)
Dim dd() As DropDownList
For i = 1 To (number of dropdownlist)
dd(i) = New DropDownList
dd(i).ID = id 'id is the id of the related quesion in the table
dd(i).AutoPostBack = True
'fed from table
For Each d As DropDownList In dds
AddHandler d.SelectedIndexChanged, AddressOf dropd
Protected Sub dropd(ByVal sender As Object, ByVal e As System.EventArgs)
Dim dd As DropDownList = CType(sender, DropDownList)
Protected Sub submit_Click(ByVal sender As Object, ByVal e As
'how to get the selectvalue here?