• Repeater checkbox 后台判断选中


     <asp:Repeater ID="GridView1" runat="server">
                                <HeaderTemplate>
                                 <tr>
       <th scope="col">
                                         <input id="all" type="checkbox" name="all" onclick="check_all(this,'checkid');" />
                                     </th><th scope="col">订单号</th><th scope="col">下单日期</th><th scope="col">订单详情</th><th scope="col">销售等级</th><th scope="col">订单状态</th><th scope="col">&nbsp;</th>
      </tr>
                                </HeaderTemplate>
                                <ItemTemplate>
                                  <tr>
       <td>
       <input id="checkbox" runat="server" type="checkbox" value="" />
                    <input type="hidden" id="HiddenID" runat="server" value='<%# DataBinder.Eval(Container.DataItem, "id")%>' />

     for (int i = 0; i < GridView1.Items.Count; i++)
            {
                if (((System.Web.UI.HtmlControls.HtmlInputCheckBox)GridView1.Items[i].FindControl("checkbox")).Checked)
                {
                    string sql = "update OrderBase set orderstate='已接收' where id=" + ((System.Web.UI.HtmlControls.HtmlInputHidden)GridView1.Items[i].FindControl("HiddenID")).Value;
                    fun.GetFunction().ExecuteSql(sql);
                }
            }

  • 相关阅读:
    redis-x64-3.2.100下载安装
    open with live server没反应
    JavaScript 语言的历史
    在navicat查看mysql的版本
    node.js安装教程
    个人简介
    C语言结课课程设计
    CommonJS 规范 与 ES6 规范
    大文件分片上传,断点续传,秒传
    babel编译
  • 原文地址:https://www.cnblogs.com/aflyfly/p/1745029.html
Copyright © 2020-2023  润新知