Custom HTML Control Tags - Lets Try Again :)

T

Tarun Mistry

Hi all, firstly appologies for the earlier stupid post.

Ok, I am using a repeater to make a table. This will be used to allow the
user to select a particular object (the table displays the contents of an
ArrayList of objects).

I would like todo this by selecting a radio button applied on each row of my
repeater. Quick example below, the "o" = a radio button.

| Name
----------
o | James
o | David
o | Bob

How do i make dynamic HTML controls? Or do i need to use manul HTML here?

I.e. i cant put the following code in my itemTemplate:

<asp:RadioButton ID="<% DataBinder.Eval(Container.DataItem, "NameID")%>"
runat="server" GroupName="objects" />

Any pointers would be appreciated!

Thanks,
Taz
 
K

krishna.bitla

Hi Taz,

You can create and add the controls dyamically to your web application.
Use the below example.

Create a table and add the table to the form. Get the handle of the
table from code behind file. Add radio button control to the table
dymically

Assume hTable is the Name of the HtmlTable

Dim htmlRow as New HtmlRow
Dim htmlColumn as New HtmlColumn

Dim rdButton as New RadioButton
rdButton.ID = "ID"
rdButton.Value = "Value"

htmColumn.Controls.Add(rdButton)
htmlRow.Columns.Add(htmlColumn)
hTable.Rows.Add(htmlRow)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top