image-button

How to send value with onclick event?

I have the following button <asp:ImageButton ID="button1" runat="server" ImageUrl="~/image.jpg" CommandName = "id" CommandArgument = "1" onclick="button1_Click" /> and in code behind protected void button1_Click(object sender, ImageClickEventArgs e) { Response.Write(e.commandName); } this does not work!!, So ...

File download when imagebutton is clicked

In my .aspx page, I have an image button that when clicked I want a file to download. When the button is clicked, it logs things to do db first. How can I push a file for download? I don't want to stream the file via asp.net on the server-side, just let the user download the file. Is this possible? ...