单选按钮分组在转发器控制中不起作用

时间:2014-12-22 06:48:06

标签: asp.net repeater

这就是我在aspx页面中尝试的内容 组名在html代码中不一样我该如何管理它请建议 我正在尝试使用转发器控件旁边的单选按钮

 <asp:Repeater ID="rptGoogleCalenderList" runat="server">
                                <ItemTemplate>
                                    <tr>
                                        <td style="width: 10px;">
                                            <asp:RadioButton ID="radiocalenderList" CssClass="grpGoogleCalenderList"  value="grpGoogleCalenderList" GroupName="GoogleCalenderList" runat="server" />
                                            <%--<input id="" type="radio" name="" />--%>
                                        </td>
                                        <td colspan="3">
                                            <asp:HiddenField ID="hfCalenderId" runat="server" Value='<%#Eval("CalenderId") %>' />
                                            <%#Eval("CalenderName") %></td>
                                    </tr>
                                </ItemTemplate>
                            </asp:Repeater>

这是为上面的代码生成的HTML   

                                    <tbody><tr>
                                        <td style="width: 10px;">
                                            <span class="grpGoogleCalenderList"><input id="Content_rptGoogleCalenderList_radiocalenderList_0" type="radio" name="ctl00$Content$rptGoogleCalenderList$ctl00$GoogleCalenderList" value="grpGoogleCalenderList"></span>

                                        </td>
                                        <td colspan="3">
                                            <input type="hidden" name="ctl00$Content$rptGoogleCalenderList$ctl00$hfCalenderId" id="Content_rptGoogleCalenderList_hfCalenderId_0" value="omiai468mpv3ghgojvsgqnsiak@group.calendar.google.com">
                                            my ct calender</td>
                                    </tr>

                                    <tr>
                                        <td style="width: 10px;">
                                            <span class="grpGoogleCalenderList"><input id="Content_rptGoogleCalenderList_radiocalenderList_1" type="radio" name="ctl00$Content$rptGoogleCalenderList$ctl01$GoogleCalenderList" value="grpGoogleCalenderList"></span>

                                        </td>
                                        <td colspan="3">
                                            <input type="hidden" name="ctl00$Content$rptGoogleCalenderList$ctl01$hfCalenderId" id="Content_rptGoogleCalenderList_hfCalenderId_1" value="">
                                            </td>
                                    </tr>

                                    <tr>
                                        <td style="width: 10px;">
                                            <span class="grpGoogleCalenderList"><input id="Content_rptGoogleCalenderList_radiocalenderList_2" type="radio" name="ctl00$Content$rptGoogleCalenderList$ctl02$GoogleCalenderList" value="grpGoogleCalenderList"></span>

                                        </td>
                                        <td colspan="3">
                                            <input type="hidden" name="ctl00$Content$rptGoogleCalenderList$ctl02$hfCalenderId" id="Content_rptGoogleCalenderList_hfCalenderId_2" value="#contacts@group.v.calendar.google.com">
                                            Birthdays</td>
                                    </tr>

                                    <tr>
                                        <td style="width: 10px;">
                                            <span class="grpGoogleCalenderList"><input id="Content_rptGoogleCalenderList_radiocalenderList_3" type="radio" name="ctl00$Content$rptGoogleCalenderList$ctl03$GoogleCalenderList" value="grpGoogleCalenderList"></span>

                                        </td>
                                        <td colspan="3">
                                            <input type="hidden" name="ctl00$Content$rptGoogleCalenderList$ctl03$hfCalenderId" id="Content_rptGoogleCalenderList_hfCalenderId_3" value="en.indian#holiday@group.v.calendar.google.com">
                                            Holidays in India</td>
                                    </tr>

                        </tbody></table>

1 个答案:

答案 0 :(得分:0)

使用HTML单选按钮代替ASP单选按钮: -

<input type="radio" name="GoogleCalenderList" />

不幸的是,asp单选按钮在转发器中不起作用,因此您需要在客户端或使用HTML控件进行解决。