Including static html file from ~/Content into ASP.NET MVC view
If you are in .Net MVC 5 and want to include a HTML file a partial file without having Razor that render it:
@Html.Raw(File.ReadAllText(Server.MapPath("~/Views/Shared/ICanHaz.html")))
You are better off using a partial view (even if it only contains static text) and include it with the Html.Partial
helper. But if you insist:
<%= File.ReadAllText(Server.MapPath("~/Content/snippet.html")) %>