Custom HTML Control Tags - Lets Try Again :)

Discussion in 'ASP .Net' started by Tarun Mistry, Feb 10, 2006.

  1. Tarun Mistry

    Tarun Mistry Guest

    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
     
    Tarun Mistry, Feb 10, 2006
    #1
    1. Advertising

  2. Tarun Mistry

    Guest

    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)
     
    , Feb 10, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ranganath

    Custom Tags within Custom Tags.

    Ranganath, Oct 17, 2003, in forum: Java
    Replies:
    2
    Views:
    461
    Ranganath
    Oct 21, 2003
  2. Mike
    Replies:
    3
    Views:
    878
    Michael Borgwardt
    Jan 9, 2004
  3. A. Brinkmann
    Replies:
    2
    Views:
    1,078
    A. Brinkmann
    Apr 16, 2004
  4. Dave
    Replies:
    0
    Views:
    451
  5. MRAB
    Replies:
    4
    Views:
    311
Loading...

Share This Page