js 获取 repeater 每行值 js+repeater 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 参考一下:http://blog.csdn.net/chinacsharper/article/details/10000983 我好像获取不到repeater里的值 用JQuery关键是看最终生成的html的结构,根据具体的特征进行绑定。后台:if (!Page.IsPostBack) { DataTable dt = new DataTable(); dt.Columns.Add("ofmuId", typeof(string)); dt.Rows.Add("1000"); dt.Rows.Add("121212"); this.Repeater1.DataSource = dt; this.Repeater1.DataBind(); }页面: <asp:Repeater ID="Repeater1" runat="server"> <HeaderTemplate> <table> </HeaderTemplate> <ItemTemplate> <tr> <td> <asp:CheckBox ID="cbx" runat="server"></asp:CheckBox> <asp:Label runat="server" ID="lbl" Text='<%#Eval("ofmuId") %>'></asp:Label> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater>JS代码: $(function () { $("table").find("tr td input[type=checkbox]").each(function () { $(this).bind("click", function () { if (this.checked) { var id = $(this).parent().parent().find("span[id*=lbl]").text(); alert(id); } }); }); });效果: 如LS的,直接用Firebug之类的浏览器调试工具看实际显示出来的html,然后用js去抓 winform数据提交问题 C# winform 变量如何设置 求CHM格式资料 获取指定网络共享打印机的状态信息 急!!! c#写的windows服务在xp系统下正常但是安装到2003系统下启动服务后停一会就停止了 开发工具C#,设备MC1000,生成文件XML(文件内容比较多,速度慢,请问是什么原因??) windows服务的问题! 文件传输问题!!大家近来看看,帮帮小弟 求一个正则表达式解析 如何屏蔽窗体的关闭按钮?谢谢指教!!! 电子表格图片显示!~~ 用Mono.Cecil(0.95)怎么调用某个对象的方法呢
后台:
if (!Page.IsPostBack)
{
DataTable dt = new DataTable();
dt.Columns.Add("ofmuId", typeof(string)); dt.Rows.Add("1000");
dt.Rows.Add("121212"); this.Repeater1.DataSource = dt;
this.Repeater1.DataBind();
}
页面:
<asp:Repeater ID="Repeater1" runat="server">
<HeaderTemplate>
<table>
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<asp:CheckBox ID="cbx" runat="server"></asp:CheckBox>
<asp:Label runat="server" ID="lbl" Text='<%#Eval("ofmuId") %>'></asp:Label>
</td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate>
</asp:Repeater>
JS代码:
$(function () {
$("table").find("tr td input[type=checkbox]").each(function () {
$(this).bind("click", function () {
if (this.checked) {
var id = $(this).parent().parent().find("span[id*=lbl]").text();
alert(id);
}
});
});
});
效果: