• 点击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();
            }

    }

  • 相关阅读:
    alter noparallel
    朝代
    asp.net core 发布包含文件
    执行dotnet *.dll启动项目,如何修改环境变量----ASPNETCORE_ENVIRONMENT
    MySQL授权--WITH GRANT OPTION
    js/ts/tsx读取excel表格中的日期格式转换
    linux test tool--"ab"
    nginx代理配置
    docker 容器与本机文件的拷贝操作
    linux系统,没有安装任何编辑器的情况,如何操作文件
  • 原文地址:https://www.cnblogs.com/candyzhmm/p/4318889.html
Copyright © 2020-2023  润新知