• 从 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; 

  • 相关阅读:
    linux 删除某种规则命名的文件
    adb shell 出现 error :
    android 开发,多个线程共用一个handler
    android 开发上传图片遇到返回 FileNotFoundException
    mysql 的存储过程调试软件
    输入adb shell 时 提示error: more than one device and emulator
    高德开发 android 出现 key 鉴权失败
    android 中设置HttpURLConnection 超时并判断是否超时
    LINQ to SQL语句(3)之Count/Sum/Min/Max/Avg
    C# 如何判断数据是否为 NaN
  • 原文地址:https://www.cnblogs.com/wellma/p/2095273.html
Copyright © 2020-2023  润新知