0

I want to be able to load a static html file into an MVC View. I can view the file using "return Redirect("staticHtmlFile") but I am looking to load the file into a view and have a friendly url. Example: Folder called "Ford" which has a html file and related css and images.

the url to show this file should look something like this "http://foo/cars/ford"

Does anyone know how I can accomplish this.

regards

1 Answer 1

1

You can return File("Server path to file").

However, you should convert that file to an MVC view instead.

Sign up to request clarification or add additional context in comments.

3 Comments

Can you also make a route directly to a static file?
@MichaelHaren: Only by making your own IRouteHandler.
Guys, if I make a route directly to a static file would it be possible to have a friendly url. If so how do I go about creating it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.