15.02.2015 Views

C# 4 and .NET 4

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

1198 ❘ ChaPTer 41 Asp.net feAtures<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

You are currently logged in as<br />

.<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

c o d e s n i p p e t P C S D e m o S i t e / M a s t e r Pa g e . m a s t e r<br />

Many of the controls here are ones that you haven ’ t looked at yet, <strong>and</strong> you will come back to those shortly.<br />

The important things to note here are the elements that hold the various content sections (header,<br />

navigation bar, <strong>and</strong> body), <strong>and</strong> the use of < % $ A p p S e t t i n g s : S i t e T i t l e % > to obtain the site title from the<br />

web.config fi le:<br />

< appSettings ><br />

< add key="SiteTitle" value="Professional <strong>C#</strong> Demo Site"/ ><br />

< /appSettings ><br />

There is also a style sheet link to StyleSheet.css :<br />

< link rel="stylesheet" href="StyleSheet.css" type="text/css" / ><br />

code snippet PCSDemoSite/web.config<br />

This CSS style sheet contains the basic layout information for the elements on this page, as well as for<br />

a section of the meeting room booker control. Note that none of the style information in this fi le includes<br />

colors, fonts, <strong>and</strong> so on. This is achieved by style sheets within themes, which you see later in this chapter.<br />

The only information here is layout information, such as sizes.<br />

Note that web site best practices have been adhered to in this chapter whenever<br />

possible. Using CSS for layout rather than tables is fast becoming the industry st<strong>and</strong>ard<br />

for web site layout <strong>and</strong> is well worth learning about. In the preceding code, # symbols<br />

are used to format elements with specifi c id attributes, whereas .mrbEventList<br />

will format an HTML element with a specifi c class attribute.<br />

siTe naVigaTion<br />

The three navigation web server controls, SiteMapPath , Menu , <strong>and</strong> TreeView , can work with an XML<br />

site map that you provide for your web site, or a site map provided in a different format if you implement<br />

an alternative site map provider. When you have created such a data source, these navigation web server<br />

controls are able to automatically generate location <strong>and</strong> navigation information for users.<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!