use RadioButtonList, see its ID to the name you want

解决方案 »

  1.   

    不用想得这么复杂的。
    看一下:http://www20.brinkster.com/icyer/ItemTemplate/ItemTemplate.htm
      

  2.   

    星宇所给的方法正是小第所采用的.思归:
        我对RadioButtonList不是很熟,我用RadioButtonList后就不会出现RadioButton了.
      

  3.   

    try <asp:RadioButtonList id=RadioButtonList1 runat="server">
                <asp:ListItem>Item 1</asp:ListItem>
                <asp:ListItem>Item 2</asp:ListItem>
                <asp:ListItem>Item 3</asp:ListItem>
                <asp:ListItem>Item 4</asp:ListItem>
                <asp:ListItem>Item 5</asp:ListItem>
                <asp:ListItem>Item 6</asp:ListItem>
             </asp:RadioButtonList>
      

  4.   

    动态是一样的啊!是用add不可以吗???
    _ct1是html自动转换的唯一id,你可以通过代码跟踪的到。
    0是第一,1是第二
    __ctl4__ctl0就是5行1列。
      

  5.   

    sorry, that is my mistake, but you can always use a client side control:<input type="radio" name="rdo" value='<%# DataBinder.Eval(Container.DataItem,"LastName") %>'/>
      

  6.   

    多谢各位帮助.
    思归大侠的方法小第也是知道的,也怪小第没说完整.由于我现在用的是UseControl来生成页面,别的开发成员也要用到此UseControl,因此不能在aspx中写,而只能在aspx.cs中写了.
      

  7.   

    你可以定义和添加usercontrol的属性或方法,来满足你的需要。对您的同事并没有影响。
      

  8.   

    对,需要将控件添加到page中间
      

  9.   

    then add a literal control into your template:
    new LiteralControl("<input type='radio' name='rdo' value='" + SomeVar+ "'>");
      

  10.   

    合乎你 的要求: 用vb写的
    http://www.dotnetbips.com/displayarticle.aspx?id=147