I wrote Controller to handle 404-page error for my MVC5 application as it was showed here. However it works only with HTML-pages that has controller and method.
It doesn't work with files\images that just has a link inside the site. For example Sample.chtml:
<a href="@material.FilePath"><i class="material-icons left">file_download</i>@material.Title</a>`
where FilePath is just reference to ~Content/images/... or ~/Content/Files/file.pdf.
When I try to go through this links I get standard 404 NotFound page and Error controller or Application_Error from Global.asax.cs doesn't call.
Especially I need this handler for file-not-found case. How can I solve this problem?
Edited : Important moment : this files has just pure-html-link and no controller\method defined.