load html file into a DIV ?

  • Thread starter Thread starter jobs
  • Start date Start date
J

jobs

I have a list of html files and entries in a database with the file
locations.

I'd like to create a buttons for each file. Any way to load an html
file into a DIV of an asp.net page?
Do I have to read the files in with stringreader ? Any other way?

Anybody got any sample code?

Thanks.
 
Use File.ReadAllText() and use the return value to the InnerHtml property of
the DIV tag (should have runat="server").

I have a list of html files and entries in a database with the file
locations.

I'd like to create a buttons for each file. Any way to load an html
file into a DIV of an asp.net page?
Do I have to read the files in with stringreader ? Any other way?

Anybody got any sample code?

Thanks.
 
Hi,

Siva said:
Use File.ReadAllText() and use the return value to the InnerHtml property of
the DIV tag (should have runat="server").

You cannot add the whole content of the HTML file into another HTML file
as is. You'll need to extract the content of the BODY tag.

HTH,
Laurent
 
Back
Top