E:\web\learnaspcom\htdocs\freebook\learn\ubtoc.xml LearnAsp.com - ASP ASP.net Free Lessons
Search Search

#1 worldwide
FREE Coding Lessons

since 1996
   THE BEST WAY to learn ASP & Asp.net!
Advertise Here!
click for details
Credits Host:
DiscountASP.net
Server Admin:
The "Team"
Contact Info.
Charles M. Carroll
<Asp.net blog>
<personal site>
xxx

ASP.net 2.0 Master Pages Sampler
by Charles Carroll

Master pages are good
This page demonstrates master pages with a code sample

   filename=/aspnet2/experiments/masterpages/page1a.aspx

<Test Script Below>


<%@ Page Language="VB" masterpagefile="First.master" %>
<asp:content runat="server" contentplaceholderID="bodyContents">
    <h2>Headline</h2>
    This is some content<br>
    Lots of SampleText<br>
    Text is Good<br>
    <h3>Now the content is done</h3>
</asp:content>
   filename=/aspnet2/experiments/masterpages/page1b.aspx

<Test Script Below>


<%@ Page Language="VB" masterpagefile="Second.master" %>
<asp:content runat="server" contentplaceholderID="bodyContents">
    <h2>Headline</h2>
    This is some content<br>
    Lots of SampleText<br>
    Text is Good<br>
    <h3>Now the content is done</h3>
</asp:content>

   filename=/aspnet2/experiments/masterpages/morecontentA.master

<Test Script Below>


<%@ Master %>
<html>
<body bgcolor="#FFFFFF"><form runat="server">
<h1>Header for Site</h1>
published on <asp:contentplaceholder id="PubDate" runat="server">xx/xx/xx</asp:contentplaceholder>        
<hr>
<Table width="100%">
    <tr>
        <td width="20%" bgcolor="silver"><h1>L<br>e<br>f<br>t</td>    
        <td width="60%">

        <asp:contentplaceholder id="MainText" runat="server">
        Default Content
        </asp:contentplaceholder>

        <td width="20%" bgcolor="orange"><h1>R<br>i<br>g<br>h<br>t</td>    
    <tr>
</Table>
<hr>
</hr>
<h1>New A Footer</h1>
written by <asp:contentplaceholder id="Authors" runat="server">--authors--</asp:contentplaceholder>        
</form></body></html>
   filename=/aspnet2/experiments/masterpages/morecontentB.master

<Test Script Below>


<%@ Master %>
<html>
<body bgcolor="#FFFFFF"><form runat="server">
<table bgcolor="blue"><tr><td>
<h1>A Totally Different Layout</h1>
<h2>published on <asp:contentplaceholder id="PubDate" runat="server"/></h2>
<h3>written by <asp:contentplaceholder id="Authors" runat="server"/></h3>
</td></tr><table>
        <asp:contentplaceholder id="MainText" runat="server">Default Content</asp:contentplaceholder>
<table bgcolor="blue"><tr><td>
<h1>A Totally Different Footer</h1>
</td></tr><table>
</form></body></html>
Chaz Wish List
Tall Tip $5
Grande Tip $20
Venti Tip $39
Tip Jar Thanks
2004 Thanks
2005 Thanks
HUGE Tip -love site