Download link in asp.net mvc -


i have uploaded document asp.net mvc 2 application application domain. there directory name "docs". want create link download document application . how that?

edited:

i taking link database. "item.downloadpath". want check value null or not .i can <% if (item.downloadpath!= null) %> put as: <% if (item.downloadpath!= null) %> ">, giving error

edited:- answers , tried these code working doc , docx document . if uploads .txt or image .jpg opens in browser. should ask download. have ?

<a href="<%= url.content("~/docs/documentname.doc") %>"> download </a> 

should work.


Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -