在DataList控件中加入RadioButton按钮,在初始化时将其中一个符合条件的行的RadioButton按钮绑定上。<asp:DataList ID="dlTopic" runat="server" Width="100%">
<HeaderTemplate>
<table width=100%>
<tr align="center" width=100%>
<td width="10%">选择</td>
<td width="10%">ID</td>
<td width="60%">选项</td>
<td width="10%">修改</td>
<td width="10%">删除</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td align="center" width="10%"><asp:RadioButton ID="rb1" runat="server" Checked='<%# Eval("iscurrent") %>' GroupName="a" /></td>
<td align="center" width="10%"><asp:Label ID="lblID" runat="server" Text='<%# Eval("voteTopicId") %>'></asp:Label></td>
<td width="60%"><asp:Label ID="lblTopic" runat="server" Text='<%# Eval("voteTopicName") %>'></asp:Label></td>
<td align="center" width="10%"><asp:Button ID="btnEdit" runat="server" Text="修 改" /></td>
<td align="center" width="10%"><asp:Button ID="btnDelete" runat="server" Text="删 除" /></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:DataList>请高手帮帮忙!谢谢!
<HeaderTemplate>
<table width=100%>
<tr align="center" width=100%>
<td width="10%">选择</td>
<td width="10%">ID</td>
<td width="60%">选项</td>
<td width="10%">修改</td>
<td width="10%">删除</td>
</tr>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td align="center" width="10%"><asp:RadioButton ID="rb1" runat="server" Checked='<%# Eval("iscurrent") %>' GroupName="a" /></td>
<td align="center" width="10%"><asp:Label ID="lblID" runat="server" Text='<%# Eval("voteTopicId") %>'></asp:Label></td>
<td width="60%"><asp:Label ID="lblTopic" runat="server" Text='<%# Eval("voteTopicName") %>'></asp:Label></td>
<td align="center" width="10%"><asp:Button ID="btnEdit" runat="server" Text="修 改" /></td>
<td align="center" width="10%"><asp:Button ID="btnDelete" runat="server" Text="删 除" /></td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:DataList>请高手帮帮忙!谢谢!
解决方案 »
- treeview点击其节点后,报错。谁能帮我看看啊?解决后立刻结贴
- asp.net,向iframe中显示的页面传递参数遇到的问题
- 有人可以免费帮我看看这个javascript 吗?
- cookie 跨域问题
- 如何开启编译在bin中的WCF服务?
- 如何在DataGrid里面产生滚动条而不滚动题头?
- 未能在"设计"视图中打开。用引号将"<% %>"块括起来....怎么解决这个问题
- 请大家给一个checkboxlist遍历的例子(要求VB)
- 关于项目的问题--思归,高手请进!!!!!!!
- WebForm中如何嵌入WinForm,WinForm要接受服务器传来的参数
- web.config中设置某个子目录或者某类文件不能访问怎写?
- 动态控件能不能引发网页刷新?
<td align="center" width="10%"><asp:RadioButton ID="rb1" runat="server" Checked='<%# Eval("iscurrent")?ture:false %>' GroupName="a" /></td>
<asp:RadioButton ID="rb1" runat="server" Checked='<%# Eval("iscurrent") %>' GroupName="a" OnCheckedChanged="Check_Clicked" /> //直接用OnCheckedChanged添加事件
void Check_Clicked(Object sender, EventArgs e)
{ // do what you want to do,here
}