zoukankan      html  css  js  c++  java
  • 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);
                }
            }

  • 相关阅读:
    jQuery火箭图标返回顶部代码
    质数和分解(完全背包)
    CodeForces
    FZU
    FZU
    Pets(匈牙利算法)
    Construct a Matrix (矩阵快速幂+构造)
    绝世好题(线性dp)
    String painter (区间dp)
    Funny Positive Sequence (思维+前缀)
  • 原文地址:https://www.cnblogs.com/aflyfly/p/1745029.html
Copyright © 2011-2022 走看看