Click here to Skip to main content
15,908,013 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am Developing new project using pure html , handler and jquery.So, I have created a shared file named Header.html which is to be used repeatedly in each file.
How to include Header.html file to new file suppose test.html in asp.net ?

Thanks in advance
Posted

Use iframes[^].

Example - HTML Iframes[^]
 
Share this answer
 
Comments
DamithSL 8-Jun-14 2:24am    
Hi Tadit, My5 for Iframes :-)
Thanks DamithSL. :)
you can use jQuery Load function like below.
HTML
<div id="new-header">
        <script>
            $("#new-header").load("header.html");
        </script>
</div>

and check below alternative approaches as well
Master Pages using HTML and JavaScript[^]
How to make MasterPage in HTML for an HTML website?[^]
Master Pages Technique in Pure html[^]
 
Share this answer
 
Comments
Nirav Prabtani 8-Jun-14 2:32am    
my 5+
try this.. :)

HTML
<html>
<head>
<title>Nirav Demo</title>
</head>

<body>

<div id="DivHeader" class="Header">
Header File With Menu.. :)
</div>

<div id="DivBody" class="Body">

<iframe id="MainFrame" style="border:none;height:500px;width:100%" src="index.html">
</iframe>

</div>

<div id="DivFooter" class="Footer">
Footer
</div>

</body>
</html>


you can change iframe source dynamically using javascript ..so your header and footer will remain same on all pages and your body part can be vary according to your need.. :)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900