Go Back   Wiki NewForum | Latest Entertainment News > Career Forum & Tips > Tech Forum & Tutorial > ASP.NET Forum & Tutorial

ASP.NET Master Pages - Interview Questions

Views: 2150  
Thread Tools Rate Thread Display Modes
Old 05-31-2009, 04:36 AM
bholus7 bholus7 is offline
Join Date: Apr 2009
Posts: 1,322
Default ASP.NET Master Pages - Interview Questions

ASP.NET Master Pages - Interview Questions

ASP.NET 2.0 introduces a new concept known as master pages, in which a common base master file contains the common look and feel and standard behavior for all the pages in your application.

Once the common content is placed in the master page, the content pages (child pages) can inherit content from the master pages apart from adding their content to the final output..........

Question - What is Master Page in ASP.NET?

Answer - A Master page offers a template for one or more web forms. It defines placeholders for the content, which can be overridden by the content pages. The content pages contains only content. When users request the content page, ASP.NET merges the layout of the master page with the content of the content page and produce output.

Question - Advantages of using Master Page in ASP.NET

Answer - Master pages enables consistent and standardized layout to the website.
You can make layout changes of the site in the master page instead of making change in the pages.
It is very easy to implement.
Question - Define Multiple Master Page.

Answer - In ASP.NET, you can have multiple master pages each for a different purpose. You can provide users several layout options using Multiple Master Page. You can define Master Page at multiple places in the web application.

You can specify page-level using the @Page dierective.
You can specify using the Web.config.

Remember that the definition closest to the user wins that means page-level definition supersedes site-level definition.
Question - How do you create Master Page?

Answer - Steps to create Master Page

Right-click your web project in the Solution Explorer window
Select Add New Item.
Select the Master Page item type from the Add New Item dialog.
Following is an example of Master Page and a Content Page.
<%@ Master %>

Title of the Pages

This is simple HTML page that serves template for other pages.
The @ Master directive at the top of the page defines that the page is Master Page.

A placeholder tag is overridden by the content page to place the content.

You can have many placeholders tag each of them with different id.
Content Page Example
%@ Page MasterPageFile="master1.master" %>

ASP Interview Questions

When you request this page, ASP.NET merges layout specified in the Master Page and content of content page to produce page result.

Reply With Quote

New topics in ASP.NET Forum & Tutorial

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Powered by vBulletin® Version 3.8.10
Copyright ©2000 - 2020, vBulletin Solutions, Inc.