zoukankan      html  css  js  c++  java
  • 从 button列表中获得 commandrgument值

    <asp:DataList ID="dlTodos" runat="server" RepeatDirection="Horizontal" Visible="false">
                            
    <ItemTemplate>
                                
    <div style="min- 100px">
                                    
    <div class="Transformation_left">
                                    
    </div>
                                    
    <div class="Transformation_middle">
                                        
    <asp:LinkButton ID="lnkTodo" runat="server" Text=' <%# Container.DataItem %> ' CommandArgument=' <%# Container.DataItem %> '
                                            OnClick
    ="lnkTodo_Click " />
                                    
    </div>
                                    
    <div class="Transformation_right">
                                    
    </div>
                                
    </div>
                                
    <div class="Clear">
                                
    </div>
                            
    </ItemTemplate>
                            
    <SeparatorTemplate>
                                
    <div style=" 50px;">
                                
    </div>
                            
    </SeparatorTemplate>
                        
    </asp:DataList>
     protected void lnkTodo_Click(object sender, EventArgs e)
        {
            
    //触发事件的Button 
            LinkButton btn = (LinkButton)sender;

            string cmd = btn.CommandArgument; 

  • 相关阅读:
    Java内部类详解
    Mac连接linux服务器
    mac 添加环境变量(jmeter添加至环境变量中)
    Charles使用断点修改返回或请求参数
    解决git clone速度慢的问题
    group by分组后获得每组中时间最大的那条记录
    使用Charles进行弱网测试
    http常见的状态码
    Mac使用Charles抓取ios手机APP中的https请求
    airtest使用poco方法的断言知识
  • 原文地址:https://www.cnblogs.com/moss_tan_jun/p/2096287.html
Copyright © 2011-2022 走看看