Skip to content Skip to sidebar Skip to footer

In My Mvc 5 Project, I Can't Access Static Html Page When Working On Local Iis

I have a simple ASP.NET MVC 5 project, i created a folder called static then created this html page inside it > static.html:

Solution 1:

You can use Url.Content() to open your static html page as below:

<a href ="@Url.Content("~/static/static.html")" target="_blank">OpenStaticPage</a>

Solution 2:

OK, That's my answer to my question, i found that this issue didn't related to MVC, its related to IIS.

When IIS get the HTTPRequest, the first thing IIS do is to search for appropriate handler to handle it.

Handlers have lot of details, but the issue here is the handler for any static page called 'StaticFile' get the extensions of the static file that it can handle from 'MIME Types', and 'MIME Types' is a configurations located in IIS, but in my case there was no MIME Types to specify the extensions of static file so i goto and install it from Add features in control panel > IIS > StaticContent feature

Post a Comment for "In My Mvc 5 Project, I Can't Access Static Html Page When Working On Local Iis"