H
hansiman
some code creates DropDownLists dynamically:
For i = 0 to ubound(arrayStatus)
Dim ddl As New DropDownList
With ddl
.ID = "item_" & i
.DataSource = dsSTATUS
.DataValueField = "StatusID"
.DataTextField = "Status"
.DataBind()
End With
Next
how do I reference these ddl in the button_click code?
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave.Click
.....
What I wanted (fails)
sValue0 = ddl.item0.SelectedValue fails
What I did:
Dim sValue0 As String = Trim(Request.Form("item_0"))
/M
For i = 0 to ubound(arrayStatus)
Dim ddl As New DropDownList
With ddl
.ID = "item_" & i
.DataSource = dsSTATUS
.DataValueField = "StatusID"
.DataTextField = "Status"
.DataBind()
End With
Next
how do I reference these ddl in the button_click code?
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles btnSave.Click
.....
What I wanted (fails)
sValue0 = ddl.item0.SelectedValue fails
What I did:
Dim sValue0 As String = Trim(Request.Form("item_0"))
/M