日期:2014-05-17  浏览次数:20362 次

关于repeater与RadioButton的问题
前台代码;
<asp:Repeater ID="rep" runat="server">
                                <ItemTemplate>
                                    <asp:RadioButton ID='RadioButton1' runat="server" Text=<%#Eval("NewsTypename")%>  Checked="True"  />
                                </ItemTemplate>                              
                            </asp:Repeater>


我想在后台循环取出repeater中的所有   RadioButton的text的值,怎么弄啊。。。

同时RadioButton、的id我想用标识列,可使用不了,那RadioButton的id如何区分呢。。

谢谢大家啦

------解决方案--------------------
引用:
引用:RadioButton的id用标识列干吗?


for (int i = 0; i < Repeater1.Items.Count; i++)
            {
                RadioButton r = Repeater1.Items[i].FindControl("RadioButton1")……

不在深圳
------解决方案--------------------
引用:
引用:RadioButton的id用标识列干吗?


for (int i = 0; i < Repeater1.Items.Count; i++)
            {
                RadioButton r = Repeater1.Items[i].FindControl("RadioButton1")……


这个,真不是因为id重复

我估计是你绑定repeater数据的代码没有放到ispostback里面