Webform(邮箱模式)
<asp:Repeater ID="Repeater1" runat="server"> <HeaderTemplate> <table id="tb1"> <tr id="tr1"> <td>全选<input type="checkbox" id="ckall" /></td> <td>学号</td> <td>姓名</td> <td>性别</td> <td>生日</td> <td>年龄</td> <td>专业</td> <td>民族</td> <td>操 作</td> </tr> </HeaderTemplate> <ItemTemplate> <tr class="tr_item" style="<%#Eval("Red")%>"> <td> <input type="checkbox" class="ck" name="aaa" value='<%#Eval("Code") %>' /></td> <td><%#Eval("Code")%></td> <td><%#Eval("Name")%></td> <td><%#Eval("SexStr")%></td> <td><%#Eval("BirStr")%></td> <td><%#Eval("Age")%></td> <td><%#Eval("SubjectName")%></td> <td><%#Eval("NationName")%></td> <td> <a id="lian" onclick="return del()" href="Delete.aspx?id=<%#Eval("Code") %>">删除</a> <a id="xiu" target="_blank" href="Update.aspx?up=<%#Eval("Code") %>">修改</a> </td> </tr> </ItemTemplate> <FooterTemplate> </table> </FooterTemplate> </asp:Repeater>
var oCkall = document.getElementById("ckall"); oCkall.onclick = function () { var oCks = document.getElementsByClassName("ck"); for (var i = 0; i < oCks.length; i++) { oCks[i].checked = oCkall.checked; } }; var oCkss = document.getElementsByClassName("ck"); for (var i = 0; i < oCkss.length;i++) { oCkss[i].onclick = function () { var count = 0; for (var j = 0; j < oCkss.length;j++) { if (oCkss[j].checked == false) { count++; } };//for if (count <= 0) { oCkall.checked = true; } else { oCkall.checked = false; } };//ockss.click }//ockss.onclick for
void Button1_Click(object sender, EventArgs e) { string aaaa = Request["aaa"]; Label1.Text = aaaa; string[] all = aaaa.Split(','); }