Html page with master page

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
 
G

Guest

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
 
G

Guest

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top