how to link to a pdf document.

Posted on 2013-10-14
Medium Priority
Last Modified: 2013-10-14
I need to have a hyperlink on my website which when clicked on will allow someone to download a pdf file, or display it if they wish.

However my syntax is incorrect and I can't figure out how to do it. I am using Asp.net which pretty much uses html. So any help would be appreciated.

       <a href="@Url.Content("~/Documents/information.pdf")">Click here to download a current copy of information</a>
Question by:brgdotnet

Accepted Solution

TalShyar earned 2000 total points
ID: 39572703
Why don't you just use plain old HTML:

<a href="/Documents/information.pdf">This is my link.</a>

Now assuming if the user has Adobe installed, the PDF will open / should open in-browser.

If you want to force the user's browser to download the file rather than opening it, check this out:

Author Closing Comment

ID: 39572820
I screwed up, and forgot to assign points. So it defaulted to 500 points. So I guess you are the lucky recipient. Thanks.

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
Entering time in Microsoft Access can be difficult. An input mask often bothers users more than helping them and won't catch all typing errors. This article shows how to create a textbox for 24-hour time input with full validation politely catching …
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Through the video, you can check the migration process of Outlook PST file to PDF. Kernel for Outlook to PDF tool can convert Outlook emails with all attributes like Subject, To, From, Cc, Bcc and other folders such as Inbox, Outbox, Sent Items, Jun…

587 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question