.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> ASP.Net >> Post New Question Subscribe to Interview Questions

What is a master page ?

Posted By :Syed Shakeer Hussain     Posted Date :May 18, 2009    Points :10   Category :ASP.Net 
1) A master page provides a framework in which the content of each page on a web site is presented. Master pages make it easy to create pages that have a consistent look.

2) The pages that provide the content that's displayed in a master page are called content pages .

3) The content of each content page is displayed in the master page's content placeholder

You can also find related Interview Question to What is a master page ?  below: 

How would you create a Master Detail page in sharepoint?

  
Creating a Content type inheriting from Folder Content Type for the master, and another Content type inheriting from Item and using them both on a List (More...)

Can we add more than one master page to our web application?

  
Yes We can add more than one master page to our web application (More...)

What is a nested master page? How do you create them?

  
A Nested master page is a master page associated with another master page. To create a nested master page, set the MasterPageFile attribute of the @Master directive to the name of the .master file of the base master page. (More...)

How can I change master page at runtime

  
The Pre_Init event is a key event to examine if we want to change the master page file programmatically.

Example:

using System;
using System.Web.UI;

public class BasePage : Page
{
public BasePage()
{
this.PreInit += new EventHandler(BasePage_PreInit);
}

void BasePage_PreInit(object sender, EventArgs e)
{
MasterPageFile = "~/Master1.master";
}
}

We get error "The 'MasterPageFile' property can only be set in or before the 'Page_PreInit' event." If we try to change master page in any other event than Pre_Init.



(More...)

Q. Can we use our custom master page with the application pages in SharePoint 2010 ?

  

Ans. With 2010, you can now set whether the pages under _Layouts use the same Master Page as the rest of your site. You can enable or disable this functionality through the web application settings in Central Administration. This however, is not applicable to your custom application pages. If you want your custom applictaion page to inherit the site master page you must derive it from Microsoft.SharePoint.WebControls.LayoutsPageBase class.
(More...)

Q. Can we use our custom master page with the application pages in SharePoint 2010 ?

  
Ans. With 2010, you can now set whether the pages under _Layouts use the same Master Page as the rest of your site. You can enable or disable this functionality through the web application settings in Central Administration. This however, is not applicable to your custom application pages. If you want your custom applictaion page to inherit the site master page you must derive it from Microsoft.SharePoint.WebControls.LayoutsPageBase class.

(More...)

Master Page in ASP.NET?

  
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. (More...)

Which is mandatory Content Placeholders Create Custom Master Page in SharePoint?

  
The Below Content Placeholders are required for backwards Compatibility:-

? PlaceHolderTitleLeftBorder
? PlaceHolderPageImage
? PlaceHolderMiniConsole
? PlaceHolderTitleRightMargin
? PlaceHolderTitleAreaSeparator
? PlaceHolderNavSpacer
? PlaceHolderLeftNavBarBorder
? PlaceHolderBodyLeftBorder
? PlaceHolderBodyRightMargin
(More...)

How-to add web part to master-page?

  
add web part to any sharepoint page using web-interface. Open this page in SharePoint Designer, find and copy tag that corresponds to your web part and tag "Register" for namespace from the begining of page. Open masterpage for edit and paste copied tags to necessary place. (More...)

What is the difference between Site Master Page and System Master Page in SharePoint?

  
The site master page will be used by all publishing pages whereas
System Master Page is Used for all forms and view pages in this site.
(More...)

Why changes in the Master page dose not visible to all users on publishing site?

  
If the Publishing feature is activated on the SharePoint site, Changes made in master page are not visible to every users even if the changed master file is checked in. It must be approved by Site Collection Administrator.
To make all changes visible to every user,
1)We need to select "Publish a major version" option while 'checking in' the master page file (in SharePoint Designer).
2)Log in with the Site Collection Administrator on SharePoint Site navigate the 'Site Settings' page and click on 'Master Pages' under 'Web Designer Galleries'.
3)Find the master page that we have changed. In the ECB (Edit control Block) menu, click on 'Approve/Reject' option.
4)After approving the changes made in the master page will be visible to all users. (More...)

How does a content page differ from a master page?

  
A content page does not have complete HTML source code; whereas a master page has complete HTML source code inside its source file. (More...)

Explain the life cycle of an ASP .NET page.

  
Life cycle of ASP.Net Web Form
Page Request >> Start >> Page Init >> Page Load >> Validation >>
PostBack Event Handling >> Page Rendering >> Page Unload
Page Request - When the page is requested ASP.Net determines
whether the page is to be parsed and compiled or a cached verion
of the page is to be sent without running the page.
Start - Page propertied REQUEST and RESPONSE are SET, if the
page is pastback request then the IsPostBack property is SET and
in addition to this UICulture property is also SET.
Page Initilization - In this the UniqueID of each property is SET.
If the request was postback the data is not yet loaded from the
viewstate.
Page Load - If it was a postback request then the data gets loaded
in the control from the ViewState and control property are set.
Validation - If any control validation present, they are performed
and IsValid property is SET for each control.
PostBack Event Handling - If it was a postback request then any
event handlers are called.
Page Rendering - Before this the viewstate is saved from the page
and RENDER method of each page is called.
Page Unload - Page is fully rendered and sent to the client(Browser)
and is discarded. Page property RESPONSE and REQUEST are unloaded. (More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend