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/page2a.aspx

<Test Script Below>


<%@ Page Language="VB" masterpagefile="moreContentA.master" %>
<asp:content runat="server" contentplaceholderID="MainText">
    <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>

<asp:content runat="server" contentplaceholderid="Authors">
Ted Jones,Sally Smith,Bill Wilson
</asp:content>

<asp:content runat="server" contentplaceholderid="PubDate">
Feb 2005
</asp:content>
   filename=/aspnet2/experiments/masterpages/page2b.aspx

<Test Script Below>


<%@ Page Language="VB" masterpagefile="moreContentB.master" %>
<asp:content runat="server" contentplaceholderID="MainText">
    <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>

<asp:content runat="server" contentplaceholderid="Authors">
Ted Jones,Sally Smith,Bill Wilson
</asp:content>

<asp:content runat="server" contentplaceholderid="PubDate">
Feb 2005
</asp:content>

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

<Test Script Below>


<%@ Master %>
<html>
<body bgcolor="#FFFFFF"><form runat="server">
<h1>Header for Site</h1>
<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="bodyContents" runat="server">
        Default Content
        </asp:contentplaceholder>
        
        </td>

        <td width="20%" bgcolor="orange">&nbsp;</td>
</table>
<h1>Footer for Site</h1>
 </form></body></html>
   filename=/aspnet2/experiments/masterpages/second.master

<Test Script Below>


<%@ Master %>
<html>
<body bgcolor="#FFFFFF"><form runat="server">
<table bgcolor="blue"><tr><td>
<h1>A Totally Different Layout</h1>
</td></tr><table>
<asp:contentplaceholder runat="server" id="bodyContents">
Just a teporary bit of text not even needed
</asp:contentplaceholder>   
<table bgcolor="blue"><tr><td>
<h1>A Totally Different Footer</h1>
</td></tr><table>

</form></body></html>

There are many worthy charities!!. But perhaps help starving children in Africa or South America AND help Charles too. a $5 tip buys him lunch at McDonalds, a $20 tip buys his kid Hitoshi a new computer game, a $39 tip buys his daughter Michiko a few nice outfits. See our donor list.