Html page with master page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi everybody.

I am converting existing web site to asp 2.0. We have a bunch of Html files
that I want to show inside of our master page I do not want to covert
existing html pages to aspx pages or user controls. Is there any way to do
this?

Thanks in advance
 
You could have an HtmlGenericControl("div") in the contentplaceholder, and
load the HTML of the requisite html page using a filestream, then attach the
resulting string of HTML markup to the InnerHtml property of your div.
Probably six other ways to do it, but that was the first one that came to my
feeble mind.

Peter
 
Peter. Thanks for your reply.

I put VB code like:

Dim lcFileName As String = Server.MapPath("MyHtm.htm")
Dim strInnerHtml As String = String.Empty
Dim sReader = New IO.StreamReader(lcFileName)
While (sReader.Peek > -1)
strInnerHtml &= sReader.ReadLine.ToString '& vbNewLine
End While

divTemplate.InnerHtml = strInnerHtml

For some reason new page looks a little bit different from original.
Some spaces that original page had disappeared. Do you have any idea why? Or
if you can prompt me other ways to accomplish that, may be they would work
for me a little bit better.

Thanks again.
 
Back
Top