How do I write a link to a static file in ASP.NET MVC?

In my MVC application, I have a folder with PDF documents that users should be able to view. However, my links to them don't seem to work: I get "resource could not be found by error". I assume my problem has something to do with routing.

What do I need to do to make the browser just display documents?

+2


source to share


1 answer


Use IgnoreRoute

to exclude certain paths from your routing logic. This post contains a number of helpful suggestions for optimizing routing.



Also make sure the permissions on the directory and the PDFs it contains are set correctly - see this answer .

+3


source







All Articles