<asp:repeater id="rptsortimgUp" runat="server" OnItemCommand="rptsortimgUp_ItemCommand" OnItemCreated="rptsortimgUp_ItemCreated">
<itemtemplate>
<a 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>
<itemtemplate>
<a 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 Object, ByVal 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_ItemCreated(ByVal sender As Object, ByVal 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 Object, ByVal 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
Protected Sub rptsortimgUp_ItemCommand(ByVal sender As Object, ByVal 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