Nested master : Master page « User Control and Master Page « ASP.Net

ASP.Net
1. ADO.net Database
2. Ajax
3. Asp Control
4. Collections
5. Components
6. Data Binding
7. Development
8. File Directory
9. HTML Control
10. Language Basics
11. Login Security
12. Mobile Control
13. Network
14. Page
15. Request
16. Response
17. Server
18. Session Cookie
19. Sitemap
20. Theme Style
21. User Control and Master Page
22. Validation by Control
23. Validation by Function
24. WebPart
25. WPF
26. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
ASP.Net » User Control and Master Page » Master page 
Nested master



<%@ Page Language="C#" MasterPageFile="~/Default.master" Title="Sample Nested Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="mainContent" Runat="Server">
  <h1>Book Rep System Home</h1>
  <p>Welcome to the book rep system</p>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="sideContent" Runat="Server">
  <h2>New Releases</h2>
  <p>Core C#</p>
</asp:Content>

File: Default.master

<%@ Master Language="C#" MasterPageFile="~/MasterDefault.master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="parentContent" Runat="Server">
   <div id="container">
      <div id="header">
      <img src="~/logo.gif" />
      <asp:Image runat="server" ID="imgLogo" ImageUrl="~/cool.gif" />
      </div>
      <div id="sideArea">
         <div id="menu">
            <asp:BulletedList ID="blstSample" runat="server" DisplayMode="HyperLink">
               <asp:ListItem Value="">Home</asp:ListItem>
               <asp:ListItem Value="">Products</asp:ListItem> 
               <asp:ListItem Value="">About</asp:ListItem>
            </asp:BulletedList>
         </div>
         <div id="sideAreaBox">
            <asp:ContentPlaceHolder ID="sideContent" runat="server">
              <p>default side content</p>
            </asp:ContentPlaceHolder>  
         </div>          
      </div>
      <div id="mainArea">
         <asp:ContentPlaceHolder ID="mainContent" runat="server">
           <p>default main content</p>
         </asp:ContentPlaceHolder>
      </div>
      <div id="footer">
         <p>footer</p>
      </div>         
   </div>
</asp:Content>

File: MasterDefault.master

<%@ Master Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div id="topNav">
       <p>
       Pearson Ed Navigator<br />
       <asp:DropDownList ID="drpPlaces" runat="server">
          <asp:ListItem>Book System</asp:ListItem>
         <asp:ListItem>A</asp:ListItem>
         <asp:ListItem>B</asp:ListItem>
       </asp:DropDownList>
       </p>
    </div>
    <asp:contentplaceholder id="parentContent" runat="server"/>
    </form>
</body>
</html>

 
Related examples in the same category
1. Nested master page (C#)
2. Use master page (C#)
3. Master page with trace (C#)
4. Two Master Pages (C#)
5. Link content page with master page
6. Master page with Default Content
7. Master in page derivative
8. Two pieces of contentplaceholder
9. master for print
10. Control title in master page with content page code
11. Nested master page
12. Use image to fill the filler in master page
13. Code behind and master page
14. Specifying master page in Web.config causes every content page to inherit from the master page
15. Specifying the master page for a specific folder in the Web.config file: Use
16. A master page that creates a GUID on the first request (C#)
17. A master page that creates a GUID on the first request (VB)
18. A master page that exposes a custom property (C#)
19. A master page that exposes a custom property (VB)
20. Exposing a server control from a master page as a public property (C#)
21. Exposing a server control from a master page as a public property (VB)
22. Overriding some default content in the content page (C#)
23. Overriding some default content in the content page (VB)
24. Using Page_PreInit to assign the master page programmatically (C#)
25. Using Page_PreInit to assign the master page programmatically (VB)
26. A content page that can work with more than one master page
27. Update the page properties in master page
28. Put site navigation in the master page
29. Master pages exposing an object model for content pages to programmatically modify elements on the master.
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.