Here is a code tag code of asp.net and there is a Image button where i want code on click event for download item i try to code on click event but it was not working
<asp:ListView runat="server" ID="ListView1" GroupItemCount="1">
<LayoutTemplate>
<div>
<asp:PlaceHolder runat="server" ID="groupPlaceHolder" />
</div>
</LayoutTemplate>
<GroupTemplate>
<div style="clear: both;">
<asp:PlaceHolder runat="server" ID="itemPlaceHolder" />
</div>
</GroupTemplate>
<ItemTemplate>
<div style="margin-left: 20px; border: 2px rgba(255, 102, 0, 0.36)
dotted; width: 900px; padding: 10px;">
<video src='<%# "Handler.ashx?id=" + Eval("id") %>'
width="900" height="400" controls="" preload=""></video>
</div>
<div style="width:950px; height:90px;" align="right">
<asp:ImageButton ID="ImageButton1"
ImageUrl="images/download-button.jpg" runat="server" width="230px"/>
</div>
</ItemTemplate>
<GroupSeparatorTemplate>
<div style="clear:both"></div>
</GroupSeparatorTemplate>
<EmptyDataTemplate>
</EmptyDataTemplate>
</asp:ListView>
Here is a c# Private code class on same page that is
Private void Download(string ID)
{
some code here for download
}
please let me know how can i code on image button for download a file.
Error:
Invalid postback or callback argument.
Event validation is enabled using
<pages enableEventValidation="true"/> in configuration or
<%@ Page EnableEventValidation="true" %> in a page.
For security purposes, this feature verifies that arguments to
postback or callback events originate from the server
control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to
register the postback or callback data for validation.