zoukankan      html  css  js  c++  java
  • 点击repeater的一个修改事件触发全部repeater每一行的修改事件

    <td align="center">
                                <asp:LinkButton ID ="btnvip" runat ="server" CommandArgument='<%#Eval("id") %>' CommandName="edit" Text ="修改"></asp:LinkButton>
                            </td>
                             <td align="center">
                                    <asp:HiddenField ID="hf" runat="server" Value='<%#Eval("Id") %>'/>
                                </td>
                 </tr>

    protected void repeater1_bind(object source, RepeaterCommandEventArgs e)
     {

          if (e.CommandName.Equals("edit"))
            {
                for (int i = 0; i < rptlist.Items.Count; i++)
                {
                    TextBox txtcom = (TextBox)rptlist.Items[i].FindControl("tbvip");
                    HiddenField hf = (HiddenField)rptlist.Items[i].FindControl("hf");
                    int id = int.Parse(hf.Value);
                    if (txtcom.Text.ToString() != "" && txtcom.Text.ToString() != null)
                    {
                        DataTable dtvip = DB.GetDataTable("businessid,busoname,businessname", "business", "businessname='" + txtcom.Text.Trim() + "'", "");
                        DB.Operate("update table  set cmId='" + dtvip.Rows[0][0].ToString() + "',Cname='" + dtvip.Rows[0][1].ToString() + "'where id='" + id + "'");
                    }

                }
                Display();
            }

    }

  • 相关阅读:
    linux:安装php7.x
    linux:搭建 WordPress 个人站点
    linux:lnmp环境
    knn初了解
    Pycharm:鼠标滚动控制字体大小
    数据集的获取
    弄懂Java的自增变量
    面试中的volatile关键字
    Java的类锁、对象锁和方法锁
    Error creating bean with name 'entityManagerFactory' defined in class path resource解决方案
  • 原文地址:https://www.cnblogs.com/candyzhmm/p/4318889.html
Copyright © 2011-2022 走看看