ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Microsoft Related  >>  ASP.NET
 
 


 

 
 Visual Basic interview questions  Visual Basic Interview Questions
 C Sharp interview questions  C Sharp Interview Questions
 ASP.NET interview questions  ASP.NET Interview Questions
 VB.NET interview questions  VB.NET Interview Questions
 COM+ interview questions  COM+ Interview Questions
 ADO.NET interview questions  ADO.NET Interview Questions
 IIS interview questions  IIS Interview Questions
 MTS interview questions  MTS Interview Questions
 Crystal Reports interview questions  Crystal Reports Interview Questions
 BizTalk interview questions  BizTalk Interview Questions
 Dot Net interview questions  Dot Net Interview Questions
 Exchange Server interview questions  Exchange Server Interview Questions
 SharePoint interview questions  SharePoint Interview Questions
 Microsoft Related AllOther interview questions  Microsoft Related AllOther Interview Questions
Question
How can you achieve nested Masterpages in 2.0?
 Question Submitted By :: Swapna
I also faced this Question!!     Rank Answer Posted By  
 
  Re: How can you achieve nested Masterpages in 2.0?
Answer
# 1
Master pages can be nested, with one master page 
referencing another as its master. Nested master pages 
allow you to create componentized master pages.
A child master page has the file name extension .master, as 
with any master page. The child master page typically 
contains content controls that are mapped to content 
placeholders on the parent master page. In this respect, 
the child master page is laid out like any content page. 
However, the child master page also has content 
placeholders of its own to display content supplied by its 
own child pages.

Examples:
This is the parent Master Page:

<% @ Master Language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" 
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<html  >
<body>
<head runat="server">
    <title>Untitled Page</title>
</head>
<form id="Form1" runat="server">
<div>
<h1>Parent Master</h1>
<p style="font:color=red">This is parent master content.</p>
<asp:ContentPlaceHolder ID="MainContent" runat="server" />
</div>
</form>
</body>
</html>

This is the Child Master Page:

<%@ Master Language="VB" MasterPageFile="~/Parent.master"%> 
<asp:Content id="Content1" 
ContentPlaceholderID="MainContent" runat="server">
   <asp:panel runat="server" id="panelMain" 
backcolor="lightyellow">
   <h2>Child master</h2>
      <asp:panel runat="server" id="panel1" 
backcolor="lightblue">
        <p>This is childmaster content.</p>
        <asp:ContentPlaceHolder ID="ChildContent1" 
runat="server" />
      </asp:panel>
      <asp:panel runat="server" id="panel2" 
backcolor="pink">
         <p>This is childmaster content.</p>
         <asp:ContentPlaceHolder ID="ChildContent2" 
runat="server" />
      </asp:panel>
      <br />
   </asp:panel>
</asp:Content>

This is the child file that references the child master 
page:

<%@ Page Language="VB" MasterPageFile="~/Child.master"%>
<asp:Content id="Content1" 
ContentPlaceholderID="ChildContent1" runat="server">
   <asp:Label runat="server" id="Label1" 
        text="Child label1" font-bold="true" />
   <br>
</asp:Content>
<asp:Content id="Content2" 
ContentPlaceholderID="ChildContent2" runat="server">
   <asp:Label runat="server" id="Label2" 
        text="Child label2" font-bold="true"/>
</asp:Content>



 
Is This Answer Correct ?    4 Yes 0 No
Amirtha
 

 
 
 
Other ASP.NET Interview Questions
 
  Question Asked @ Answers
 
When web.config is called ? Keane-India-Ltd2
what is the difference between server.Transfer and response.redirect in .net  1
What is CLS? PrimeLine1
What are skins?  1
when using personlization, how do you access over setting at runtime?  1
What base class do all Web Forms inherit from?  2
How would you get ASP.NET running in Apache web servers - why would you even do this?  1
How to Deploy a project?  2
Features in ASP.NET ? Microsoft1
Can we change the session timeout in ASP.NET, if yes then how and from where? L&T7
I create small website, i want accept all the browser this website? what will do?  1
How to kill session? Protech11
Define ViewState and how can it be used?  3
Hi , I am Basha. I am searching a job in dotnet.Plz tell me the order of page events in asp.net 2.0> plz send faq's related to c#.net,asp.net,sqlserver2000 etc. to my mail-id : bashask.ss@gmail.com Sapient4
What is Boxing and Unboxing? Accenture6
Explain what a diffgram is, and a good use for one?  2
why many web.config files are used in are project  2
What are Themes? What is their use ?  1
Difference between .NET components and COM components? Microsoft1
Can we use multiple forms in single asp.net application? Polaris2
 
For more ASP.NET Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com