repeater中<ItemTemplate>绑定一列图片按钮,如何在后台编写此按钮事件
<asp:repeater id= "rptContract " runat= "server ">
<HeaderTemplate>
<table width= "98% ">
</HeaderTemplate>
<ItemTemplate>
<tr>
<td>
<%#DataBinder.Eval(Container.DataItem, "filename ")%> //文件名
</td>
<td width= "30 " align= "center ">
<asp:ImageButton id= "btnDown " BorderWidth= "0 " ImageUrl= "images/download.gif " Runat= "server " ToolTip= "点击下载 "> </asp:ImageButton> </td>
</tr>
</ItemTemplate>
<FooterTemplate>
</table>
</FooterTemplate> </asp:repeater>
如何在后台编写些btnDown按钮事件,点击可下载相应的文件。(下载模板不需要,只需把相应的文件名传入)
------解决方案--------------------添加委托事件,在该事件中写
------解决方案--------------------Button1.Click+=new EventHandler(this.Button1_Click)
------解决方案--------------------e.Item.FindControl( "btnDown ")这一句的返回为null