Labels

slider

Recent

Navigation

Master And Content Pages in ASP.Net

Master Page, Content Page, UI Design, master pages in asp.net, content pages in asp.net, master pages c#
ASP.Net Master Page’s application allows us to create a consistent layout of the UI. We can create a master page in asp.net application; moreover can create multiple content pages where ever we can display content.
Master page has a extension with .Master

Master Page Directive:


<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="TCSite.master.cs" Inherits="slnTCMasterContentPage.TCSite" %>

 

 Content Page Directive:


<%@ Page Title="" Language="C#" MasterPageFile="~/TCSite.Master" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="slnTCMasterContentPage.WebForm1" %>

In above page directive we are calling master page from content page in asp.net.
Content page contains no markup outside the Content control in asp.net. There is a great flexibility in asp.net that we can create multiple master pages to provide different layouts for our application, we can create multiple content pages of each master page in asp.net.  With Master and content pages we can provide more flexibility to our application, so we can make required modifications in our layout in the middle of development with spending few times.

Step 1: Add Master page, right click in project property, and then click on Add new Item, now you will see Installed Template where you can select Master Page, finally click on OK.

Master Page

Step 2: Now you can right click on Master Page (TCSite.Master), and then click Add Content Page.

TCSite.Master


Step 3: Finally, you can see final view of Content Page.

Content Page View

 Download Sample in Zip: 
Down Load



ASP.Net Interview Questions:




Share

Anjan kant

Outstanding journey in Microsoft Technologies (ASP.Net, C#, SQL Programming, WPF, Silverlight, WCF etc.), client side technologies AngularJS, KnockoutJS, Javascript, Ajax Calls, Json and Hybrid apps etc. I love to devote free time in writing, blogging, social networking and adventurous life

Post A Comment:

0 comments: