zoukankan      html  css  js  c++  java
  • 在 repeater控件中有button控件,如何点击button按钮在后头产生方法

     <asp:Repeater ID="Repeater1" runat="server" OnItemCommand="Repeater1_ItemCommand">
          <ItemTemplate>
              <ul>
                  <li>
                         <%#Eval("id") %></li>
                    <li>
                     <asp:TextBox ID="TextBox3" runat="server"></asp:TextBox>
                    <asp:Button ID="Button3" runat="server" CommandName="Insert" CommandArgument='<%#Eval("id") %>' Text="添加" /></li>

                  </ul>
                </ItemTemplate>
           </asp:Repeater>
       </div>



    protected void Repeater1_ItemCommand(object source, RepeaterCommandEventArgs e)
        {
            if (e.CommandName == "Insert")
            {
                int id = int.Parse(e.CommandArgument.ToString());
                string str = ((TextBox)e.Item.FindControl("TextBox3")).Text;

                //插入数据库
            }
        }

  • 相关阅读:
    poj2502(最短路)
    poj1511(最小环和)
    uva11090(spfa判负环)
    hdu4370(spfa最短路最小环)
    uva10561(SG)
    uvalive5059(SG)
    uvaliva3905(扫描线)
    scu4445(模拟)
    uvalive3902(树上的最优化 贪心)
    scu4444(完全图最短路)
  • 原文地址:https://www.cnblogs.com/q101301/p/3693735.html
Copyright © 2011-2022 走看看