|
.net
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Custom HTML Control Tags - Lets Try Again :)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 How do i make dynamic HTML controls? Or do i need to use manul HTML here?---------- o | James o | David o | Bob 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 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)
Other interesting topics
Using american dates by default
Duplicate custom controls List files in a directory, modify name. PostBackURL to new window browser compat issue 'Timeout period elapsed prior to obtaining a connection from the pool.' - Please help. Why use disconnected datasets? Referencing the data within a sqldatasource dataset Datagrid at sort postback how can i retrivie the sortcommand before binding? How do I set the CssClass for a GridView sorting link? |
|||||||||||||||||||||||