need2progm
Programmer
Is it possible to get the value of a control that has been dynamically built with a string builder from an aspx page?
This is what I have so far :
For Each a In Accounts
Dim newfile As New AccountFile( a.AccountID , 1 , User )
Dim Row As New System.Web.UI.HtmlControls.HtmlTableRow()
Dim cellA As New System.Web.UI.HtmlControls.HtmlTableCell()
Dim cellB As New System.Web.UI.HtmlControls.HtmlTableCell()
cellA.InnerHtml = newFile.AccountText
'build and add DropDown
Dim sbSelectAccount As New StringBuilder()
sbSelectAccount.Append("<SELECT id= 'userAccount' runat='server'>"
For Each name In collectionNames
Dim new Name As New NameAccount( name.nameID , 1 , Session("User")
sbSelectAccount.Append("<OPTION value= " NameAccount.NameID & " >"
sbSelectAccount.Append(" " & NameAccount.AccountText & " "
sbSelectAnswer.Append("</OPTION>"
Next
sbSelectAnswer.Append("</SELECT>"
cellB.InnerHtml = sbSelectAnswer.ToString
Row.Cells.Add(cellA)
Row.Cells.Add(cellB)
Next
This returns a drop down box that is populated with (8+items) that are selectable. What I need to know is how do to get the selected item value (text) or ID on post back using vb code behind?.. willing to rewrite in c# if need be.
Thanks for any ideas on how to approach this.
This is what I have so far :
For Each a In Accounts
Dim newfile As New AccountFile( a.AccountID , 1 , User )
Dim Row As New System.Web.UI.HtmlControls.HtmlTableRow()
Dim cellA As New System.Web.UI.HtmlControls.HtmlTableCell()
Dim cellB As New System.Web.UI.HtmlControls.HtmlTableCell()
cellA.InnerHtml = newFile.AccountText
'build and add DropDown
Dim sbSelectAccount As New StringBuilder()
sbSelectAccount.Append("<SELECT id= 'userAccount' runat='server'>"
For Each name In collectionNames
Dim new Name As New NameAccount( name.nameID , 1 , Session("User")
sbSelectAccount.Append("<OPTION value= " NameAccount.NameID & " >"
sbSelectAccount.Append(" " & NameAccount.AccountText & " "
sbSelectAnswer.Append("</OPTION>"
Next
sbSelectAnswer.Append("</SELECT>"
cellB.InnerHtml = sbSelectAnswer.ToString
Row.Cells.Add(cellA)
Row.Cells.Add(cellB)
Next
This returns a drop down box that is populated with (8+items) that are selectable. What I need to know is how do to get the selected item value (text) or ID on post back using vb code behind?.. willing to rewrite in c# if need be.
Thanks for any ideas on how to approach this.