473,326 Members | 2,061 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

include HTML code from html 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

}

Nov 19 '05 #1
1 1915
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.
"Kevin" <pe******@hotmail.com> wrote in message news:ec**************@TK2MSFTNGP15.phx.gbl...
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

}

Nov 19 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
by: mark | last post by:
IF I have something like this: <title><?php print($pagetitle); ?></title> <body> <?php include("folders/my_include.php"); ?> </body> </html> and my_include.php contains the value to the...
2
by: Greg | last post by:
I'm new to html and web coding, this is a simple one - appreciate your help! I'm attempting to get my browser bar links to reside in a single .asp file to avoid multiple additions to pages when...
21
by: .:mmac:. | last post by:
I have to update a page every week. I get the page ahead of time so I used the "scheduled includes" webbot in Frontpage only to find that I would have to refresh the page every week to have it...
5
by: Tony Strazzeri | last post by:
Hi all, I a fairly new to html and Javascripting. I have been trying to write some code to hide my email address from spam harvesters. I copied the code from various web examples and modified...
6
by: tshad | last post by:
In my User control, I tried to do this: *************************************************************************** <Script runat="server"> Public ClientName As String = "<!-- #include file =...
1
by: ningjun.wang | last post by:
I need to include to static html files in my asp.net page. The order of include depend on query string. Here is the pseudo code mypage.aspx: <% string mode = Request; if (mode == "A") {...
4
by: Jon Slaughter | last post by:
I'm using eval to excute some mixed php and html code but I cannot debug it. I am essentially using filegetcontents to load up a php/html file and then inserting it into another php/html file and...
3
by: =?Utf-8?B?QnJhbmRvbg==?= | last post by:
Hi, I have an aspx page that has the "include" code in it which includes another page that displays information. I also have an upload page that allows users to upload a simple html document...
4
by: Kevin G. | last post by:
Hello all, I have a flat HTML page with 3 distinct HTML tables, and I'm trying to randomly display the tables when the page loads, without repeating. My idea is to use the PHP include() function...
12
by: Geoff Cox | last post by:
Hello I'm having a problem loading a frameset file using an include in a php file. Nothing is displayed and when I look at the source code I see that <html> <head> <title></title>
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.