Click here to Skip to main content
11,430,402 members (75,764 online)
Rate this: bad
good
Please Sign up or sign in to vote.
See more: ASP.NET
Hi All,

I have a web application and in that I have a folder named as Download and I have a docx file as instructions.docx.
In aspx page I took a button and onlick button I want to download instructions.docx from its path means "~/Download/instructions.docx" .I tried my best but I am unable to do it.

Please help me in sorting out my problem.

Thanking You.
Mohd. Wasif
Posted 14-Feb-11 1:13am
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

Use this code on Button click
Response.Redirect("~/Download/instructions.docx");

It is very simple.On clicking this it will display the Options, based on this you can save it by selceting your Location.
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 4

If you want to force save as dialog then see the following

http://aspalliance.com/259[^]

http://www.west-wind.com/weblog/posts/76293.aspx[^]
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Hello Mohd.Wasif

You can simply do it with the help of
Response.Redirect("~/Download/instructions.docx");

It is working perfectly.
When you click on the Button.. The file Download box will appear having the option of Open, Save and Cancel..


Hope this will help you.

Regards
Shweta
Rose | [Rose]
  Permalink  
Comments
Sandeep Mewara at 14-Feb-11 7:59am
   
Good answer. 5!
ShwetaSaxena at 15-Feb-11 3:42am
   
@Sandeep Thanks
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

write the following code on button click event

Response.Redirect("~/Download/instructions.docx");
  Permalink  
v2
Comments
Sandeep Mewara at 14-Feb-11 7:59am
   
Yep!

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



Advertise | Privacy | Mobile
Web04 | 2.8.150428.2 | Last Updated 14 Feb 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100