repeater内按纽值的获取

前台代码
<asp:Repeater ID="rptRightItemList" runat="server">
                                            
<ItemTemplate>
                                                
<div>
                                                    
<%#Eval("displayname")%></div>
                                                
<asp:Panel ID="plSubStoreLimite" runat="server" onmousemove="showBorder(this)" onmouseout="notShowBorder(this)">
                                                    
<table cellpadding="0" cellspacing="0">
                                                        
<tr>
                                                            
<td style="padding-left: 5px">
                                                                
<asp:Label ID="labSubStoreLimite" runat="server" Text='<%# Eval("displayname") %>'
                                                                    ForeColor
="#0066FF"></asp:Label>
                                                            
</td>
                                                            
<td style="padding-left: 5px">
                                                                
<asp:ImageButton ID="imgbtnDelRight" runat="server" ImageUrl="../images/delButtom.gif"
                                                                    CssClass
="delButtomImg" OnClientClick="return confirm('确认删除?')" OnClick="imgbtnDelRight_OnClick" CommandArgument='<%#Eval("id") %>' />
                                                                
                                                            
</td>
                                                        
</tr>
                                                    
</table>
                                                
</asp:Panel>
                                            
</ItemTemplate>
                                        
</asp:Repeater>

 

后台代码
        protected void imgbtnDelRight_OnClick(object sender, EventArgs e)
        {
            ImageButton imgbtnDelRight 
= (ImageButton)sender;

            Tdep_Right daRight 
= new Tdep_Right();
            
if (!daRight.Delete(int.Parse(imgbtnDelRight.CommandArgument)))
            {
                Alert(
"删除失败");
                
return;
            }
            Alert(
"删除成功");
        }
posted on 2009-11-30 17:55  石牌村夫  阅读(343)  评论(0编辑  收藏  举报