I have a website which I want to have a consistent style (a header and a side menu) in every page.
I want to create something similar to a master page for it. I don't want to use frames.
How could I achieve this using HTML, CSS, JavaScript and jQuery?
To create a master page, right-click on the project name in the Solution Explorer and choose Add New Item. Then select the Master Page type from the list of templates and name it Site. master .
Add the master page into our project. Right click Project->Add->New item (shown in the picture), After clicking on new item, Window will open, select Web Form->Web Forms Master Page (shown in the picture), After clicking the add button, master page 'site1.
Master page allows you to create a consistent look and behavior for all the pages in your web applications. Master Page Design is common for all the pages. Master page actually consists of two pieces, the master page itself and one or more content pages. A master page is an ASP.NET file with the extension .
you can use jQuery Load function to include header or menu html page, for example, to include a common header html file,
<div id="new-header">
<script>
$("#new-header").load("header.html");
</script>
</div>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With