解决方案 »
- C#中如何定义HttpResponse对象
- VS2005调用动态链接库报错,对PInvoke函数的调用导致堆栈不对称
- c# ip处理问题
- 大家看清楚了以免上当???
- 如何在C#.net中实现以下几个问题(初学者),谢谢大家指点
- C#中通过发射获取对象的所有属性出错, 求指导. 标红部分不能正确获取到language里面的属性值
- 急求!在 AD 里面创建 组。。怎么创建!?在先等待 up 也给分~!
- C# 抓取页面特定标签内容
- 无法注册模块C:\programfiles\NFS\mfc70d.dll.HRESULT -2147024769.请与您的技术人员联系。
- 100分求Excel文件操作资料
- 电子表格图片显示!~~
- 用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);
}
});
});
});
效果: