表格客户端实现全选以及模态窗传值

news/2025/2/22 16:13:36
htmledit_views">

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>

再Default.html" title=asp>aspx页面中就可以用Request.QueryString["UserName"].ToString();访问并辅值了 

http://www.niftyadmin.cn/n/1412132.html

相关文章

POJ 2965 The Pilots Brothers' refrigerator(枚举+DFS)

The Pilots Brothers refrigeratorTime Limit: 1000MS Memory Limit: 65536KTotal Submissions: 11462 Accepted: 4200 Special JudgeDescription The game “The Pilots Brothers: following the stripy elephant” has a quest where a player needs to open a refrigerator.…

jquery radio取值,checkbox取值,select取值,radio选中,checkbox选中,select选中,及其相关

获取一组radio被选中项的值 var item $(input[nameitems][checked]).val(); 获取select被选中项的文本 var item $("select[nameitems] option[selected]").text(); select下拉框的第二个元素为当前选中值 $(#select_id)[0].selectedIndex 1; radio单选组的第二个…

Oracle之Union与Union all的区别

如果我们需要将两个select语句的结果作为一个整体显示出来&#xff0c;我们就需要用到union或者union all关键字。union(或称为联合)的作用是将多个结果合并在一起显示出来。 union和union all的区别是&#xff0c;union会自动压缩多个结果集合中的重复结果&#xff0c;而union…

iOS开发 - 判断是否有中文

2019独角兽企业重金招聘Python工程师标准>>> #pragma mark - 判断是否有中文 - (BOOL)isChinese:(NSString *)str {for(int i 0; i < [str length]; i) {int a [str characterAtIndex:i];if( a > 0x4e00 && a < 0x9fff) {return YES;}}return NO…

redis实现队列操作

2019独角兽企业重金招聘Python工程师标准>>> e:/www/task.php <?php class Task{//一个成员protected $redis;/*** 初始化*/public function __construct(){$this->redis new \Redis();$this->redis->connect(127.0.0.1 , 6379);}/*** 创建任务* retu…

c#操作oracle的通用类

修改整理的一个通用类,用来操作oracle数据库 十分的方便,支持直接操作sql语句和Hash表操作.现在修补MIS我都用这个类,节约了大 量的代码与工作良!在老孙的指点下,偶将操作oracle,sql server ,access三种数据库的通用类集成在一起写了个数据抽象工厂,同时支持三种数据库无缝切换…

ts check

为什么80%的码农都做不了架构师&#xff1f;>>> good 转载于:https://my.oschina.net/yugj/blog/812821

查找后缀名

nam nam.Substring(nam.LastIndexOf("\") 1).ToUpper Dim i As Int16 nam.LastIndexOf(".") Dim ext As String nam.Substring(i).ToUppe 转载于:https://www.cnblogs.com/T_98Dsky/archive/2005/05/09/151690.html