zoukankan      html  css  js  c++  java
  • 其实repeater的ItemCreated和ItemCommand事件也蛮好用的。

    <asp:repeater id="rptsortimgUp" runat="server" OnItemCommand="rptsortimgUp_ItemCommand" OnItemCreated="rptsortimgUp_ItemCreated">
                                            
    <itemtemplate>
                                                
    <href='<%# DataBinder.Eval(Container, "DataItem.f_url") %>' target="_blank"><img width="16" height="16" hspace="3"
                                    align
    ="absmiddle" src='/Images/FileIcons/icon_<%# DataBinder.Eval(Container, "DataItem.f_type") %>.gif' border="0"><%# DataBinder.Eval(Container, "DataItem.f_name"%></a><span style="font-size:11px">
                                                    [
    <%# DataBinder.Eval(Container,    "DataItem.f_size""{0:N0} Bytes"%>]</span>
                                                
    <asp:ImageButton ID="ibnsortimgUpDelete" ImageUrl="/Images/icon_delete.gif" Width="13" Height="13" ImageAlign="AbsMiddle" CommandName="Delete" CommandArgument='<%# DataBinder.Eval(Container, "DataItem.f_id") %>' causesvalidation="False" runat="server">
                                                
    </asp:ImageButton>
                                            
    </itemtemplate>
                                            
    <separatortemplate>
                                                |
                                            
    </separatortemplate>
                                        
    </asp:repeater>
    ' 添加附件删除确认
        Protected Sub rptsortimgUp_ItemCreated(ByVal sender As ObjectByVal e As RepeaterItemEventArgs)
            
    If e.Item.ItemType = ListItemType.Item Or e.Item.ItemType = ListItemType.AlternatingItem Then
                
    Dim myDeleteButton As ImageButton = CType(e.Item.FindControl("ibnsortimgUpDelete"), ImageButton)
                myDeleteButton.Attributes.Add(
    "style""cursor:hand")
                myDeleteButton.Attributes.Add(
    "onclick""return confirm('您确定要删除这个附件吗?')")
            
    End If
        
    End Sub
     'rptsortimgUp_ItemCreated
    ' 删除附件
        Protected Sub rptsortimgUp_ItemCommand(ByVal sender As ObjectByVal e As RepeaterCommandEventArgs)
            
    If e.CommandName = "Delete" Then
                Connect()
                
    Dim strID As String = e.CommandArgument.ToString()
                FileUP.sortimgUp.Delete(conn, strID)
                GetsortimgUp()
                Disconnect()
            
    End If
        
    End Sub
     'rptsortimgUp_ItemCommand
  • 相关阅读:
    容器(四)实现容器的底层技术【25】
    容器(四)限制容器的 Block IO【24】
    容器(四)限制容器对CPU的使用【23】
    容器(四)限制容器对内存的使用【22】
    容器(四)一张图搞懂容器所有操作【21】
    容器(四)容器常用操作【20】
    容器(四)运行容器的最佳实践【19】
    容器(四)进入容器的方法【18】
    容器(四) 运行容器方法【17】
    51单片机学习笔记
  • 原文地址:https://www.cnblogs.com/LCX/p/271076.html
Copyright © 2011-2022 走看看