weto
weto

Reputation: 69

ASP.NET add Link to file

I want to add to table cell in asp table link to file, which is in application folder and is a word document (.docx). How can I add this link here?

...
<asp:TableRow>
<asp:TableCell> here I want to add link to file in application folder Content/Files/document.docx </asp:TableCell>
</asp:TableRow>

Thx.

Upvotes: 0

Views: 2209

Answers (1)

Aik
Aik

Reputation: 3748

What about use link element? <a href="Content/Files/document.docx">document</a>.

If app folder is not accessible directly you have to create handler to provide content of this file and use the Server.MapPath method to properly locate the file:

Server.MapPath("~/Content/Files/document.docx")

Upvotes: 1

Related Questions