Tom:
here's a fictious example:
Dim options As New RadioButtonList
For Each row As DataRow In ds.Tables(0).Rows
Dim item As New ListItem
item.Text = CStr(row("Name"))
item.Value = CStr(row("Id"))
options.Items.Add(item)
Next
Dim parent As String = CStr(ds.Tables(1).Rows(0)("Parent"))
Select Case parent
Case "sideNav"
columnSidenav.Controls.Add(options)
Case "footer"
footerCoontainer.Controls.add(options)
Case Else
paceholderDefault.Controls.add(options)
End Select
98% chance you can get rid of the entire for each loop and replace it with a
databind expression:
Dim options As New RadioButtonList
options.DataSource = ds.Tables(0)
options.DataTextField = "name"
options.DataValueField = "id"
options.DataBind()
the select case parent was just to show how you can add the radiobutton to
different containers at runtime..
Karl
--
MY ASP.Net tutorials
http://www.openmymind.net/
"Tom Jackson" <tj************@home.com> wrote in message
news:Ox**************@TK2MSFTNGP15.phx.gbl...
Can anyone please point me in the right direction. I want to create some
simple controls (radio buttons) at runtime. The problem is that I don't
know how many radio buttons I need or where they go until I read the database
at runtime.
Thanks