Reputation: 10499
I need to include the same html
page into several aspx
pages. Following is my html
page:
<h1>Database Enciclopedico</h1>
And I use the Response.WriteFile
method to include the page in my aspx
page:
<div id="header">
<% Response.WriteFile("Header.html"); %>
</div>
The problem is that when the html page is included it has several new lines and white spaces at its beginning (I can see the result when I inspect the element with Google Chrome).
How can I solve this problem?
Upvotes: 1
Views: 1474
Reputation: 77
use HTML iframe like this:
<iframe id='iframe1' name='iframe1' src='abc.html'>//also add attributes of height and width
</iframe>
Upvotes: 0
Reputation: 8928
Please try the following approach:
<%
string path = HttpContext.Current.Server.MapPath("Header.html");
string content = System.IO.File.ReadAllText(path);
Response.Write(content);
%>
Upvotes: 1