Posted on: 2/28/2011 1:46:53 AM | Views : 295

Hello.
I have a webForm which has a dropDownList, a linkButton and a gridView. When I select an option from the dropDownList the gridView gets filled with data from a database. The gridView has 6 columns. Two of those columns are ItemTemplate (ImageButtons).
In the RowDataBound event, I set the PostBackUrl property of the Image buttons.
imgBtn1.PostBackUrl = "FileDownload.aspx?FileName=" + nameofFile1;
imgBtn2.PostBackUrl = "FileDownload.aspx?FileName=" + nameofFile2;
FileDownload.aspx is just a blank page that "process" the file. Page_Load event has the following code:
string fileName = "\\server\folder\" + Request.QueryString["FileName"]; FileInfo file = new FileInfo(fileName); // Checking if file exists if (file.Exists) { try { Response.ContentType = ReturnExtension(file.Extension.ToLower()); ...

Go to the complete details ...