Render HTML file in ASP.NET MVC view?

Follow these steps

  1. Create a view in ~/views/shared folder. give it name test.cshtml.
  2. Copy the content of HTML in it.
  3. Use Html.Partial("test") on page to render the html of that view.

You can't use Html.Partial for this.It is a special helper method for rendering Partial Views. Instead you can add an Action like this:

[ChildActionOnly]
public ActionResult GetHtmlPage(string path)
{
   return new FilePathResult(path, "text/html");
}

And you can call it from your View with using Html.Action helper Method:

@Html.Action("GetHtmlPage","controllername", new { path = "~/Test/main.html" })

I think it's a better solution: Use WriteFile from the Response object

@Response.WriteFile(pathToMyHtmlFile)

taken from here