I am trying to build a page which can read the contents of a HTML file and output it's data to the screen.
To get the HTML files data I am doing:
ViewBag.PageHtml = System.IO.File.ReadAllText(@"W:\1.html");
Then in the View, I have the following
@Html.Raw(ViewBag.PageHtml)
The HTML data is this:
<html>
<head>
<title>Test Title</title>
</head>
<body>
<p>The body</p>
</body>
</html>
The result of the Html.Raw is this, some how the <html><head>
etc tags are being removed.
<title>Test Title</title>
<p>The body</p>
Can someone please explain to me why this is, and how I can prevent it from happening?
Thanks in advance