include HTML code from html page

K

Kevin

How do I include mb.html if I check file is existed? I'm assuming I do this in codebehind, but how?

Basically if the file exists, it should display the page that will include mb.html.





---------------------------------------------------------------------------------------------------------

html code inside mb.html

<table><tr><td>9/27/2005 11:00:43 AM</td><td>God is great!</td></tr></table>
<table><tr><td>9/27/2005 11:01:03 AM</td><td>I love Jesus</td></tr></table>



In my codebehind,

if (File.Exists(Server.MapPath(mb.html)))

{

// include mb.html html code



}

else

{

do something else

}
 
S

Siva M

I don't think it is possible in that way. Rather, read the content of the file if it exists and assign it to a Label control's Text property. Place the Label control where you the mb.html's content should appear on the page.
How do I include mb.html if I check file is existed? I'm assuming I do this in codebehind, but how?

Basically if the file exists, it should display the page that will include mb.html.





---------------------------------------------------------------------------------------------------------

html code inside mb.html

<table><tr><td>9/27/2005 11:00:43 AM</td><td>God is great!</td></tr></table>
<table><tr><td>9/27/2005 11:01:03 AM</td><td>I love Jesus</td></tr></table>



In my codebehind,

if (File.Exists(Server.MapPath(mb.html)))

{

// include mb.html html code



}

else

{

do something else

}
 

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

Members online

Forum statistics

Threads
473,755
Messages
2,569,537
Members
45,022
Latest member
MaybelleMa

Latest Threads

Top