1.表格客户端全选
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/html" title=xhtml>xhtml1/DTD/html" title=xhtml>xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/html" title=xhtml>xhtml">
<head runat="html" title=server>server">
<title>实现客户端表格全选</title>
<script language="html" title=javascript>javascript" type="text/html" title=javascript>javascript">
// <!CDATA[
//表格全选
html" title=function>function CheckAll(oCheckbox) {
var GridView1 = document.getElementById("<%=GridView1.ClientID %>");
for(i = 1;i < GridView1.rows.length; i++)
{
GridView1.rows[i].cells[1].getElementsByTagName("INPUT")[0].checked = oCheckbox.checked;
}
}
</script>
</head>
<body>
<form runat="html" title=server>server">
<div>
<html" title=asp>asp:GridView runat="html" title=server>server" AllowPaging="True" AllowSorting="True"
DataSourceID="SqlDataSource1">
<Columns>
<html" title=asp>asp:TemplateField HeaderText="序号">
<ItemTemplate>
<%# Container.DataItemIndex+1 %>
</ItemTemplate>
</html" title=asp>asp:TemplateField>
<html" title=asp>asp:TemplateField>
<HeaderTemplate>
<input type="checkbox" runat="html" title=server>server" /><label>全选</label>
</HeaderTemplate>
<ItemTemplate>
<html" title=asp>asp:CheckBox runat="html" title=server>server" />
</ItemTemplate>
</html" title=asp>asp:TemplateField>
</Columns>
<HeaderStyle ForeColor="Black" HorizontalAlign="Center" />
</html" title=asp>asp:GridView>
2.模态窗体传值
调用的页面,点击按钮执行此方法,最下面的为模态窗体返回值后刷新页面
html" title=function>function searchInfo()
{
var username=document.getElementById("txtName").value;
var windowDialog = window.showModalDialog("Default.html" title=asp>aspx?UserName="+username,"","dialogWidth=500px; dialogHeight=300px");
window.location.reload();
}
用来承载html" title=asp>aspx页面的html页面
<HTML>
<HEAD>
<script language="html" title=javascript>javascript">
html" title=function>function ResolveUrl()
{
var frm = window.frames[0];
frm.location = location.toString().replace("Default.htm","Default.html" title=asp>aspx");
}
</script>
</HEAD>
<BODY style="margintop:0;marginleft:0;marginright:0;marginbottom:0" >
<table align="left" cellpadding="0" cellspacing="0" width="100%" height="100%" >
<tr>
<td valign="top" width="100%" height="100%"><iframe border="0" width="100%" height="100%"></iframe></td>
</tr>
</table>
</BODY>
</HTML>