zoukankan      html  css  js  c++  java
  • GridView与CheckBox

     a.aspx

    <head runat="server">

        <title></title>

         <script language="javascript" type="text/javascript">

            function Allno(e)

            {

                var aa=document.getElementsByName("chkno");

                for(var i=0;i<17;i++)

                {

                    aa[i].checked = e.checked;     

                }

            }

        </script>

    <asp:GridView ID="GridView1"  runat="server" AutoGenerateColumns="False" AllowPaging="True" PageSize="20">

            <Columns>

               <asp:TemplateField>

               <HeaderTemplate>

               <input type="checkbox" name="chkAllno" title="全选" onclick="Allno(this)">

               </HeaderTemplate>

               <ItemTemplate>

               <input type="checkbox" name="chkno" value="<%#DataBinder.Eval(Container.DataItem,"PARAM_KJ_ID").ToString()%>" />

               </ItemTemplate>

               </asp:TemplateField>

               <asp:TemplateField HeaderText="序号">

                    <ItemTemplate>

                        <%#Container.DataItemIndex+1 %>

                    </ItemTemplate>

                </asp:TemplateField>

            </Columns>

    </asp:GridView>

    a.aspx.cs

       

    string list = Request.Params["chkno"];

    string[] Group = list.Split(',');

     

  • 相关阅读:
    .htaccess
    windows快速搭建wamp环境,多站点域名访问
    require与include的区别
    PHP常用操作的字符串函数
    高效做事的习惯
    成功?!
    面向对象程序设计
    失落 绝望
    jquery学习收获
    XML操作类
  • 原文地址:https://www.cnblogs.com/yidianfeng/p/1357608.html
Copyright © 2011-2022 走看看