views:

378

answers:

1

I have a link of a file, and I don't know how to add it to imagebutton. I want to see the 'open-save-cancel' , screen when imagebutton is clicked, but imagebutton doesn't seems to be taking the link of file as a file, but taking it as a page url and tring to open the file url as page.

Thanks

+2  A: 
    //OnClick server Handler

    Response.Clear();
    Response.AddHeader(
        "content-disposition", string.Format("attachment; filename={0}", "file_name"));

    Response.ContentType = "application/octet-stream";

    Response.WriteFile("file_path");
    Response.End();
this. __curious_geek