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
  • 相关阅读:
    vue3.0+vite+ts项目搭建axios封装(六)
    vue3.0+vite+ts项目搭建分环境打包(四)
    vue3.0+vite+ts项目搭建初始化项目(一)
    MFC数值型关联变量和控件型关联变量
    SVN服务端、客服端安装与配置
    (转)ev4加密视频破解 ev4破解工具 ev4转mp4转换器 【无视授权密码即可转换】
    C#中的记录(record)
    C#自定义转换(implicit 或 explicit)
    C#中的隐式转换
    C#中的显式转换
  • 原文地址:https://www.cnblogs.com/LCX/p/271076.html
Copyright © 2011-2022 走看看