Beruflich Dokumente
Kultur Dokumente
Master
Pages, Th
Themes and
d Site
Sit
Navigation
http://freepdf-books.com
Agenda
g
`
Master Pages
`
`
Themes
`
`
http://freepdf-books.com
Master Pages
Master Page
Content Page
http://freepdf-books.com
Site.master
<%@ Master %>
<asp:ContentPlaceHolder
C t tPl
H ld
ID="Main"
RunAt="server" />
default.aspx
<%@ Page MasterPageFile="Site.master" %>
<asp:Content
C t tPl
ContentPlaceHolderID=
H ld ID
"Main" RunAt="server" />
</asp:Content>
http://freepdf-books.com
http://.../default.aspx
%>
%>
Resulting Page
< asp :Content
runat = server
ContentName
= Main >
>
= Main
/>
= Footer
ContentName
= Footer >
>
/>
http://freepdf-books.com
http://freepdf-books.com
http://freepdf-books.com
http://freepdf-books.com
http://freepdf-books.com
Master Pages:
g
Creating
g a master p
page
g
1. Create a master page with .master extension
2 Define a master directive:
2.
<%@ master .. %>
3. Add content:
Can contain any html or control page content
Define replaceable place-holder regions:
Use an <asp:contentplaceholder> control
Add default content within it (optional)
http://freepdf-books.com
<script runat="server">
</script>
<html xmlns="http://www
xmlns= http://www.w3.org/1999/xhtml
w3 org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<table border="0" cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td colspan="2" style="height: 100px">
<img src="images/asp_net_logo.gif" />
<span style="font-size:
style font size: 24pt">Minder
24pt >Minder Chen ASP
ASP.NET
NET Learning Web Site</span></td>
</tr>
<tr>
<td style="width: 49px" valign="top">
<asp:Menu ID="Menu1" runat="server">
</asp:Menu>
</td>
<td>
</td>
</tr>
</table>
</div>
</form></body></html>
http://freepdf-books.com
Default Content
`
`
http://freepdf-books.com
Method 1
http://freepdf-books.com
Method 2
http://freepdf-books.com
http://freepdf-books.com
http://freepdf-books.com
http://freepdf-books.com
<asp:Content
C
ID="Content1"
ContentPlaceHolderID="ContentPlaceHolder1"
Runat="Server">
Runat
Server
<strong><span style="font-size: 14pt">This is a web site developed
by Minder Chen to help others to learn ASp.NET 1.X and 2.0.
<br />
He has used ASP.NET for more than 3 years by now and has
developed a Web-based Decision Support System using ASP.NET. He can be
reached at minderchen@hotmail.com
minderchen@hotmail com
<br />
</span></strong>
</asp:Content>
/
C
http://freepdf-books.com
Applying
pp y g a Master Page
g to a Site
<configuration>
<system web>
<system.web>
<pages masterPageFile="~/MasterPage.master" />
</system.web>
</configuration>
http://freepdf-books.com
Site Navigation
`
Menu - Navigation
g
User Interface (UI)
( )
TreeView - Navigation User Interface (UI)
SiteMapPath - "Bread crumb" UI controls
SiteMapDataSource - XML site maps
http://freepdf-books.com
Site Navigation
`
`
Menu Control
Two Approaches:
`
`
http://freepdf-books.com
Click to View
Menu Editor Window
Web.sitemap
`
<?xml version="1
version= 1.0
0" encoding=
encoding="utf
utf-8
8" ?>
<siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
<siteMapNode url="Default.aspx" title="Home" description="Home Page">
<siteMapNode url="Assignments.aspx" title="Assignments"
description="Programming
description=
Programming assignments">
assignments >
<siteMapNode url="Assignment1.aspx" title="Assignment 1"
description="Programming assignment 1" />
<siteMapNode url="Assignment2.aspx" title="Assignment 2"
description="Programming
description=
Programming assignment 2"
2 />
</siteMapNode>
<siteMapNode url="AboutUs.aspx" title="About Us"
description="Authors and purposes">
<siteMapNode url=
url="ContactInfo
ContactInfo.aspx
aspx" title=
title="Contact
Contact information"
information
description="Contact phones and emails" />
<siteMapNode url="ManagementTeam.aspx" title="Management Teams"
description="Introduction of management teams" />
</siteMapNode>
</siteMapNode>
</siteMap>
http://freepdf-books.com
Navigation
Ch
Choose
d
data
t source
Choose Site Map. This will select your
Web sitemap file you created in your project
Web.sitemap
as data source and will populate your menu
with items defined in the file
http://freepdf-books.com
Themes
`
`
FFonts
Borders for buttons and textboxes
Makes hyperlinks sensitive to mouse movements
08b - 26
Theme Folders
`
2.
http://freepdf-books.com
Skins
`
`
`
`
08b - 29
http://freepdf-books.com
http://freepdf-books.com
<configuration>
g
<system.web>
<pages theme="BcitTheme" />
</system.web>
</configuration>
http://freepdf-books.com
} else {
Page.Theme = (string)Session["Theme"];
http://freepdf-books.com
http://freepdf-books.com
http://freepdf-books.com
Any Questions
http://freepdf-books.com