Create A Master Page and Inherit Pages With It

Master Page

Master Page is the template or theme of our website which is designed with different client side languages like HTML, CSS, JavaScript & AJAX etc. Once we design the master page we can inherit multiple web pages from it.

A Web Page Basically Divides Into Main Three Parts:

  • Header
  • Main Body
  • Footer

Header Consists of Most Upper Portions of the Website, Which Consists Of Main Headings and Drop down Links Of Website E.g:

Web design

Main Content Is The Central Part Of The Website Where Data Is Dynamically Changed With Different Pages. Every page has its own Main Content Like this:

 

Footer Is The Lowest Part Of the Website which Contains the Publishing Details and Links Of References E.g:
ABOUT

Now We Just Design The Master Page and Make the Main Content Place Holder Empty Because Every Page Puts its Own Content In According to its Concern.

Open Visual Studio 2015:

Step 1: Create A New Project in Web.

ASP.NET WEB Application

 

Step 2: Choose Empty Form and click ok.



Step 3: 
There will be a empty project open and Now Add A Master Page By Right Clicking on Project and Adding a New Item.

Add new item

 

Step 4: Now select the Master Page.

master page

 

Step 5: Now open Master Page.

Design

Step 6: There Are Two ContentPlaceHolders In The Master Page By Default; First For Header And the Second For Main Content.

Now Customize Your Page. I Take the Kidengarden Templete.

Copy the files and paste into your project.

past

 

Step 7: Now Files Are Added In Your Project.

Webapplication

Step 8: Now Add ContentPlaceHolders Where You Want To Change Data Dynamically In Every Page From Inherited Master Page.

Code

Step 9: Now Inherit Page Named Index.aspx Which Ha Slider And Main Content Data.

index

Step 10: See Its Design.




Step 11: 
Now Add Another Page Named Contact.Aspx.

Contact.Aspx

 

Step 12: Design Of Contact Pageis Here.

 

In This Way You Can Create Multiple pages Inherited From Master Page.

Ebook Download
View all
Learn
View all