Click here to Skip to main content
15,914,905 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
how can i capture/find click event of open/save/cancel button of file download window
of IE 7.0 in Asp.net
Posted
Comments
Sandeep Mewara 1-Jun-12 5:41am    
Not clear. What do you mean by capture click/find event ?
Member 8861818 1-Jun-12 5:55am    
on btn click i write code for generate report in excel.
so in IE file download window open .
window having 3 btn open,save,cancel.
i want event of open ,save,cancel btn.

1 solution

following is the code for file download window

C#
const string fName = @"C:\picture.bmp";
      FileInfo fi = new FileInfo(fName);
      long sz = fi.Length;

      Response.ClearContent();
      Response.ContentType = MimeType(Path.GetExtension(fName));
      Response.AddHeader("Content-Disposition", string.Format("attachment; filename = {0}",System.IO.Path.GetFileName(fName)));
      Response.AddHeader("Content-Length", sz.ToString("F0"));
      Response.TransmitFile(fName);
      Response.End();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900