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
  • 相关阅读:
    windows 下安装MongoDB
    vue.js环境在window和linux安装
    python3的hashlib库sha256、pbkdf2_hmac、blake2b基本用法
    Locust 接口性能测试
    PyTestReport自动化报告使用说明
    Google开发者F12工具面板-network详解
    AppScan基础使用
    pip下载速度慢解决方法
    pycharm工具设置py模板
    jmeter实操及性能测试基础知识整理
  • 原文地址:https://www.cnblogs.com/LCX/p/271076.html
Copyright © 2011-2022 走看看