一个repeater,每个ItemTemplate中都有一个radiobuttonlist和一个按钮,我如何在按下这个按钮时对这个radiobuttonlist进行操作呢?如下:
<asp:Repeater ID="repeaterAnswer" Runat="server">
<ItemTemplate>
<TR>
<TD>
<TABLE cellSpacing="1" cellPadding="4" width="100%" align="center" bgColor="#cccccc" border="0">
<TR bgColor="#eeeded">
<TD class="normal" vAlign="top" width="86%" bgColor="#f0f8ff">
<DIV class="normal" align="left">
<DIV align="left">
<asp:Label ID="LabelRepeaterUserId" Runat="server">
<%# DataBinder.Eval(Container.DataItem,"SubmitUser")%>
</asp:Label>于
<asp:Label ID="LabelRepeaterSubmitTime" Runat="server">
<%# DataBinder.Eval(Container.DataItem,"SubmitTime")%>
</asp:Label>回答:
</DIV>
</DIV>
</TD>
</TR>
<TR bgColor="#ffffff">
<TD class="normal" vAlign="top">
<DIV align="left">
<BLOCKQUOTE><FONT face="宋体" size="2">
<asp:Label ID="LabelRepeaterTitle" Runat="server">
<%# DataBinder.Eval(Container.DataItem,"Title")%>
</asp:Label><br>
<br>
<asp:Label ID="LabelRepeaterContent" Runat="server">
<%# DataBinder.Eval(Container.DataItem,"Content")%>
</asp:Label></FONT></BLOCKQUOTE>
</DIV>
<asp:RadioButtonList ID="rblComment" Runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" AId='<%# DataBinder.Eval(Container.DataItem,"Id")%>'></asp:RadioButtonList><asp:Button ID="btnComment" Runat="server" Text="提交"></asp:Button>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</ItemTemplate>
</asp:Repeater>
<asp:Repeater ID="repeaterAnswer" Runat="server">
<ItemTemplate>
<TR>
<TD>
<TABLE cellSpacing="1" cellPadding="4" width="100%" align="center" bgColor="#cccccc" border="0">
<TR bgColor="#eeeded">
<TD class="normal" vAlign="top" width="86%" bgColor="#f0f8ff">
<DIV class="normal" align="left">
<DIV align="left">
<asp:Label ID="LabelRepeaterUserId" Runat="server">
<%# DataBinder.Eval(Container.DataItem,"SubmitUser")%>
</asp:Label>于
<asp:Label ID="LabelRepeaterSubmitTime" Runat="server">
<%# DataBinder.Eval(Container.DataItem,"SubmitTime")%>
</asp:Label>回答:
</DIV>
</DIV>
</TD>
</TR>
<TR bgColor="#ffffff">
<TD class="normal" vAlign="top">
<DIV align="left">
<BLOCKQUOTE><FONT face="宋体" size="2">
<asp:Label ID="LabelRepeaterTitle" Runat="server">
<%# DataBinder.Eval(Container.DataItem,"Title")%>
</asp:Label><br>
<br>
<asp:Label ID="LabelRepeaterContent" Runat="server">
<%# DataBinder.Eval(Container.DataItem,"Content")%>
</asp:Label></FONT></BLOCKQUOTE>
</DIV>
<asp:RadioButtonList ID="rblComment" Runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" AId='<%# DataBinder.Eval(Container.DataItem,"Id")%>'></asp:RadioButtonList><asp:Button ID="btnComment" Runat="server" Text="提交"></asp:Button>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</ItemTemplate>
</asp:Repeater>
解决方案 »
- 如何短时间做一个网站?
- 请教一个关于Gridview内各行计算的问题
- 请问打包安装过程中 ,通过自己的程序可以自动的取消安装吗
- ASP.NET 与SQL2000的问题!
- System.Web.HttpUtility.UrlEncode(url); //在js下如何运用????????????
- 急等:关于网络路径与虚拟路径问题,web放在c:\intput\root下,D盘另有一个图片目录,请教怎么得到它的相对路径
- [ASP.NET] IHttpModule 验证每个 Page 的 Session 的问题:
- 请问了:
- 我想用vs.net来看下载的网站代码,该怎么做?
- 疑问???JavaScript中可以调用C#中的变量或函数吗???
- 急!! 我在datagrid中做update操作,但是取到的值还是未更改之前的值,为什么啊?
- 如何把文本框里的日期在javascript中转换
<ItemTemplate>
<TR>
<TD>
<TABLE cellSpacing="1" cellPadding="4" width="100%" align="center" bgColor="#cccccc" border="0">
<TR bgColor="#eeeded">
<TD class="normal" vAlign="top" width="86%" bgColor="#f0f8ff">
<DIV class="normal" align="left">
<DIV align="left">
<asp:Label ID="LabelRepeaterUserId" Runat="server">
<%# DataBinder.Eval(Container.DataItem,"SubmitUser")%>
</asp:Label>于
<asp:Label ID="LabelRepeaterSubmitTime" Runat="server">
<%# DataBinder.Eval(Container.DataItem,"SubmitTime")%>
</asp:Label>回答:
</DIV>
</DIV>
</TD>
</TR>
<TR bgColor="#ffffff">
<TD class="normal" vAlign="top">
<DIV align="left">
<BLOCKQUOTE><FONT face="宋体" size="2">
<asp:Label ID="LabelRepeaterTitle" Runat="server">
<%# DataBinder.Eval(Container.DataItem,"Title")%>
</asp:Label><br>
<br>
<asp:Label ID="LabelRepeaterContent" Runat="server">
<%# DataBinder.Eval(Container.DataItem,"Content")%>
</asp:Label></FONT></BLOCKQUOTE>
</DIV>
<asp:RadioButtonList ID="rblComment" Runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" AId='<%# DataBinder.Eval(Container.DataItem,"Id")%>'></asp:RadioButtonList><asp:Button ID="btnComment" Runat="server" Text="提交"></asp:Button>
</TD>
</TR>
</TABLE>
</TD>
</TR>
</ItemTemplate>
</asp:Repeater>
然后在Repeater的ItemCommand事件中处理这个CommandNmae
然后同时用获得其他控件,譬如LABEL/TEXTBOX这样控件那样
Dim rbl as RadioButtonList = ctype(e.item.findcontrol("xxx"),RadioButtonList)
这样,然后自己看着操作了..