Thursday, 18 February 2016

How To Create A Master Page And Inherit Pages With It

Master Page

Master Page Is The Template Or Theme Of Our Website Which Is Design 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 Divide Into Main Three Parts:
  • Header
  • Main Body
  • Footer
Header Consist Of  Most Upper Portion Of Website Which Consist Of Main Headings & Drop down Links Of Website E.g:



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 E.g: 





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




Now We Just Design The Master Page and Make A Main Content Place Holder Empty Because Every Page Put Their Own Content In According to their Concern.


Open Visual Studio 2015:


Step 1:

Create A New Project in Web




Step 2:
Choose  Empty Form and click ok



Step 3:

There will be a empty project open & Now Add A Master Page By Right Click on Project And Add New Item.





Step 4:


Now select the Master Page 




Step 5:


Now open Master Page





Step 6:

There Are Two ContentPlaceHolders In The Master Page By Default First For Header And Second For Main Content.
Now Customize Your Page I Take the Kidengarden Templete..

Copy the files and paste into your project





Step 7:


Now Files Are Added In Your Project





Step 8:


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




Step 9:


Now Inherit Page Named Index.aspx Which Have Slider And Main Content Data..



Step 10:


See Its Design...




Step 11:


Now Add Another Page Named Contact.Aspx.....



Step 12:


Design Of Contact Page Here....




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






No comments:

Post a Comment