How to render my external html file inside the div element in MVC?

2.3k views Asked by At

I have tried @Html.Raw(Model) but it renders only the plain html. The css styles are not embedded in view.

How to render a Html file inside the div with the css styles?

Thanks in advance!

1

There are 1 answers

0
Balaji Marimuthu On

Try something like that, but not sure whether it's included the css.

@Html.Raw(File.ReadAllText(Server.MapPath("~/Index.html")))

Suggest you to create the partial view and call it in your view page.

@Html.Partial("~/Views/Shared/_Index")