hello i want to write a filedownload code behind html button how its possible...??

i don't know how to write asp.net(c#) code behind html button on click event?

6 Years
Discussion Span
Last Post by mani508

Are you using Visual Studio? If so, drop an image button on the page, double click it, it wil create the click event in the code behind.


yes i m using visual studio but i want to write code behind html button is it possible...???


filedownload code? not sure what you mean. if all you want to do is provide a download from a button or image, just place that item within the starting and ending tag for a link. for example...

<a href="#">Image or button goes here</a>

When the user clicks on the link, the file will be downloaded.

If you want to do something in the code behind, colect information, write to a database, etc..., then do that and then redirect the user to the file...for example,

reponse.redirect("path to URL").


i am use AppendFormat string builder.i write a button code inside appendFormat.....but i don't know how write button on click event code inside appendFormat....

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.