其实repeater的ItemCreated和ItemCommand事件也蛮好用的。
2005-11-07 23:54
525 查看
<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"
<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_ItemCommand()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
<itemtemplate>
<a href='<%# DataBinder.Eval(Container, "DataItem.f_url") %>' target="_blank"><img width="16" height="16" hspace="3"
<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_ItemCommand()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
相关文章推荐
- 其实repeater的ItemCreated和ItemCommand事件也蛮好用的。
- Repeater数据控件的两个重要事件ItemDataBound 和 ItemCommand
- [Repeater]三個事件的執行先後?ItemDataBound / ItemCreated / ItemCommand
- [Repeater]三个事件的执行先后?ItemDataBound / ItemCreated / ItemCommand
- Repeater数据控件的两个重要事件ItemDataBound 和 ItemCommand
- Repeater控件的ItemCreated事件实现权限与ItemCommand事件
- Grid事件解析与有关ItemCreated和ItemDataBound与ItemCommand的理解
- 如何在 Repeater 的事件中得到 当前 Item 绑定的数据?
- DataGrid的ItemCreated和ItemDataBound事件使用小技巧!
- DataGrid的ItemCreated和ItemDataBound事件
- Repeater 的操作,数据的显示,绑定,动态取控件中的值和Repeater1_ItemCommand事件的相关用法
- DataGrid的ItemCreated和ItemDataBound事件
- Repeater的ItemCommand事件(LinkButton)
- 牛腩购物 8 整合用户留言 动软生成器 ,.NET在后置代码中输入JS提示语句(背景不会变白),repeater 循环的时候事件判断,repeater 隔行 奇数行,item列,隐藏区块 Panel 的使用,前台绑定代码的时候使用函数
- Repeater为啥无法触发ItemCommand事件
- ItemCreated和ItemDataBound事件的区别
- repeater中的checkbox 的方法以及datalist中放了一个按牛!为什么我按该按牛时候不能触发ItemCommand事件的主要原因
- Repeater的ItemDataBound 事件中e.Item.DataItem 转换问题
- Repeater 为什么不激发 ItemCommand事件了?
- Repeater 控件的 ItemCommand 事件