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

ruby - When to use an ORM (Sequel, Datamapper, AR, etc.) vs. pure SQL for querying -

php - PHPDoc: @return void necessary? -

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