Microsoft® Expression® Web 3 In Depth

Jim Cheshire

image

800 East 96th Street
Indianapolis, Indiana 46240

MICROSOFT® EXPRESSION® WEB 3 IN DEPTH

Copyright © 2010 by Que Publishing

All rights reserved. No part of this book shall be reproduced, stored in a retrieval system, or transmitted by any means, electronic, mechanical, photocopying, recording, or otherwise, without written permission from the publisher. No patent liability is assumed with respect to the use of the information contained herein. Although every precaution has been taken in the preparation of this book, the publisher and author assume no responsibility for errors or omissions. Nor is any liability assumed for damages resulting from the use of the information contained herein.

ISBN-13: 978-0-7897-3981-0
ISBN-10: 0-7897-3981-X

Library of Congress Cataloging-in-Publication Data:

Cheshire, Jim.
  Expression Web 3 in depth / Jim Cheshire.
       p. cm.
  Includes index.
  ISBN 978-0-7897-3981-0
1.  Web sites—Authoring programs. 2.  Microsoft Expression Web. I. Title.
 TK5105.8883.C55 2010
006.7'8—dc22
                                                          2009035623

Printed in the United States of America

First Printing: October 2009

Associate Publisher
Greg Wiegand

Acquisitions Editor
Loretta Yates

Development Editor
Kevin Howard

Managing Editor
Patrick Kanouse

Senior Project Editor
Tonya Simpson

Copy Editor
Megan Wade

Indexer
Christine Karpeles

Proofreader
Elizabeth Scott

Technical Editor
Kathleen Anderson

Publishing Coordinator
Cindy Teeters

Book Designer
Anne Jones

Compositor
TnT Design, Inc.

Trademarks

All terms mentioned in this book that are known to be trademarks or service marks have been appropriately capitalized. Que Publishing cannot attest to the accuracy of this information. Use of a term in this book should not be regarded as affecting the validity of any trademark or service mark.

Microsoft is a registered trademark of Microsoft Corporation.

Expression is a registered trademark of Microsoft Corporation.

Warning and Disclaimer

Every effort has been made to make this book as complete and as accurate as possible, but no warranty or fitness is implied. The information provided is on an “as is” basis. The author and the publisher shall have neither liability nor responsibility to any person or entity with respect to any loss or damages arising from the information contained in this book.

Bulk Sales

Que Publishing offers excellent discounts on this book when ordered in quantity for bulk purchases or special sales. For more information, please contact

U.S. Corporate and Government Sales
1-800-382-3419
[email protected]

For sales outside the United States, please contact

International Sales
[email protected]

Dedication

This book is dedicated to my lovely wife, Becky, and my two children. I love you all very much.

Contents at a Glance

Introduction

I An Overview

1 An Overview of Expression Web 3

II Creating Content in Expression Web 3

2 Creating, Opening, and Importing Sites

3 Creating Pages and Content

4 Using Page Views

5 Using Tables and Layout Tables

6 Using Frames

7 Editing Tag Properties

8 Using the Quick Tag Tools

9 Using Graphics and Multimedia

10 Using Find and Replace

11 Configuring Page Editor Options

12 Maintaining Compatibility and Accessibility

13 Using SuperPreview

III Publishing and Managing Websites

14 Publishing a Site

15 Site Management and Reporting

16 Using Web Packages

IV Using CSS in Expression Web 3

17 Creating Style Sheets

18 Managing CSS Styles

V Scripting, DHTML, and Other Dynamic Content

19 Using Dynamic Web Templates

20 Using Interactive Buttons

21 Using Behaviors

22 Client-side Scripting

23 Using Layers

24 Using Form Controls

VI ASP.NET and PHP Development

25 Using Standard ASP.NET Controls

26 Using ASP.NET Navigation Controls

27 Using ASP.NET Master Pages and User Controls

28 Developing a Login System Using ASP.NET

29 Form Validation Using ASP.NET

30 Using ASP.NET Web Parts

31 ASP.NET AJAX Extensions

32 Using PHP

33 Using the Microsoft Expression Development Server

VII Managing Data with ASP.NET

34 Displaying and Editing Database Data with ASP.NET

35 Sending Email Using ASP.NET (this chapter is online)

Index

Contents

Introduction

I An Overview

1 An Overview of Expression Web 3

The Expression Web 3 Interface

Panels

The Folder List

The Design Surface

The Status Bar

Working with Sites

Creating Sites

Site Reports

Publishing Sites

Tools for Creating Pages

Powerful Table Tools

Dynamic Web Templates

Find and Replace

Editing Tag Properties

Quick Tag Tools

Powerful CSS Tools

Style Builder

Manage Styles Panel

Apply Styles Panel

Site Optimization

Accessibility Reports

Compatibility Reports

SuperPreview

CSS Reports

Scripting and Dynamic Content

Interactive Buttons

Behaviors

Layers

Photoshop Content

Deep Zoom Images

Video

ASP.NET Controls

PHP Support

Data Access Features

II Creating Content in Expression Web 3

2 Creating, Opening, and Importing Sites

What Is a Site?

How Expression Web 3 Maintains a Site

Sites and Subsites

Site Templates

Types of Sites

Disk-based Sites

FTP Sites

HTTP Sites

Importing Sites

Using the Import Site Wizard

Step 1: Choosing an Import Method

Step 2: Specifying a Destination Web Location

Step 3: Finish

Deciding on a Site Type

3 Creating Pages and Content

Creating Pages

General Page

ASP.NET Pages

CSS Layouts

Style Sheets

Frames Pages

Importing Files

Formatting Text

How Expression Web 3 Formats Text

Font Families

Font Sizes

Creating Hyperlinks

Targeting Hyperlinks

Hyperlink Parameters

HTML Bookmarks

Hyperlink ScreenTips

Spell-Checking

Configuring Page Properties

General Tab

Formatting Tab

Advanced Tab

Custom Tab

Language Tab

Using Code Snippets

Configuring File Editors

Making the Most of Code Snippets

4 Using Page Views

Introduction to Page Views

Working in Design View

Visual Aids

Ruler and Grid

Tracing Images

Adjusting Page Size

Working in Code View

Customizing Code Formatting

Quick Tag Tools

IntelliSense

Context Menu

Bookmarks

Working in Split View

Taking Advantage of Page Views

5 Using Tables and Layout Tables

The Origin of Tables

The Makeup of an HTML Table Tag

The align Attribute

Table Borders

The cellpadding Attribute

The cellspacing Attribute

The frame Attribute

Rows, Columns, and Cells

The colspan and rowspan Attributes

Aligning Content in Cells

Tables in Expression Web 3

Inserting Tables

Customizing Tables

Layout Tables and Cells

Designing Layout with Tables

Using the Layout Tables Panel

Lagniappe (lan yap’) n., a gift or bonus

Designing for Multiple Resolutions Using Tables

6 Using Frames

Using Frames in Sites

When to Use Frames

When Not to Use Frames

Creating Frames Pages

Configuring Frames

Splitting Frames

Deleting Frames

Creating Alternative Content

Targeting Frames

Adding and Configuring Inline Frames

Lagniappe (lan yap’) n., a gift or bonus

Tips for Frames

7 Editing Tag Properties

An Introduction to Tag Properties

Understanding the Tag Properties Panel

Viewing Tag Properties with the Tag Properties Panel

Setting Tag Attributes with the Tag Properties Panel

Creating a Page

Setting Tag Properties

Using Events with the Tag Properties Panel

Lagniappe (lan yap’) n., a gift or bonus

Tag Properties and Web Standards

8 Using the Quick Tag Tools

Introduction to the Quick Tag Tools

Locating and Selecting Elements Using the Quick Tag Selector

Editing Page Content Using the Quick Tag Editor

Editing a Tag

Removing a Tag

Inserting HTML

Wrapping a Tag

Controlling Positioning

Editing Tag Properties

Lagniappe (lan yap’) n., a gift or bonus

When to Use the Quick Tag Editor

9 Using Graphics and Multimedia

Web Image Formats

The GIF Format

The JPEG Format

The PNG Format

Inserting Images

Formatting Images

Resizing Images

Changing Picture Properties

Converting Images

Creating Image Thumbnails

Configuring Auto Thumbnails

Creating Image Maps

Inserting Multimedia

Inserting Flash Movies

Inserting Silverlight Applications

Inserting Silverlight Video

Inserting Deep Zoom Images

Inserting Windows Media

Importing Adobe Photoshop Files

Page Transitions

Lagniappe (lan yap’) n., a gift or bonus

Serving Video

10 Using Find and Replace

An Introduction to Find and Replace

Finding and Replacing Text

Using Regular Expressions

Finding Text

Replacing Text

Using HTML Rules in Find and Replace

Finding and Replacing HTML Tags

Saving Queries

Lagniappe (lan yap’) n., a gift or bonus

Editing and Removing Recent Searches

11 Configuring Page Editor Options

Accessing Page Editor Options

Exploring Page Editor Options

The General Tab

AutoThumbnail Tab

Default Fonts Tab

Code Formatting Tab

CSS Tab

Color Coding Tab

Authoring Tab

Picture Tab

Code Snippets Tab

Ruler and Grid Tab

IntelliSense Tab

Font Families Tab

Experiment to Learn More

12 Maintaining Compatibility and Accessibility

An Introduction to Accessibility

Designing for Accessibility

Accessible Hyperlinks

Accessible Tables

Accessible Frames

Other Accessibility Considerations

Using the Accessibility Checker

Checking Accessibility

Working with the Accessibility Panel

Generating Accessibility Reports

Designing for Compatibility

What Is Browser Compatibility?

Compatibility Features in Expression Web 3

Identifying Code Problems

Marking Invalid Code

Using Reports to Find Problems

Lagniappe (lan yap’) n., a gift or bonus

Seeing Color

13 Using SuperPreview

An Overview of SuperPreview

SuperPreview

How SuperPreview Generates a Preview

The SuperPreview Interface

Pointer Modes

DOM Highlighting

UI Helpers

Layout Modes

Preview URL

Baseline and Comparison Browser Selectors

DOM Tab

Browser Size Drop-down

Using SuperPreview to Preview Layout

Setting Up the Previews

Generating Previews

Fixing Rendering Problems

Using the Snapshot Panel

Lagniappe (lan yap’) n., a gift or bonus

Building Layouts with SuperPreview

III Publishing and Managing Websites

14 Publishing a Site

What Is Publishing?

Server Options for Publishing

FTP

FrontPage Server Extensions

WebDAV

File System

Publishing Content

Configuring a Publishing Destination and Publishing a Site

Optimizing HTML During Publishing

Troubleshooting HTTP Publishing

Lagniappe (lan yap’) n., a gift or bonus

Hosting Your Site

15 Site Management and Reporting

Site Settings

General Tab

Preview Tab

Advanced Tab

Publishing Tab

Site Reports

Configuring Reports

Saving Reports

Lagniappe (lan yap’) n., a gift or bonus

Better Site Reporting

16 Using Web Packages

What Are Web Packages?

Creating a Web Package

Importing a Web Package

Lagniappe (lan yap’) n., a gift or bonus

Capitalizing on Web Packages

IV Using CSS in Expression Web 3

17 Creating Style Sheets

An Introduction to CSS

The Purpose of CSS

How CSS Is Applied to Pages

External Style Sheets

Embedded Style Sheets

Inline Styles

Formatting Content with CSS

Positioning Content with CSS

CSS Classes

Basic Application of a CSS Class

Applying Multiple CSS Classes

Pseudo-Classes

Pseudo-Elements

Lagniappe (lan yap’) n., a gift or bonus

Centering a DIV with CSS

18 Managing CSS Styles

Expression Web 3’s CSS Tools

Apply Styles Panel

Manage Styles Panel

Link Style Sheet Dialog

CSS Properties Panel

CSS Reports

Style Builder

Working with Styles

Using the Manage Styles Panel

Using the Apply Styles Panel

Using the CSS Properties Panel

Using the Style Builder

Using the Attach Style Sheet and Link Style Sheet Dialogs

CSS Reports

Checking for CSS Errors

Checking CSS Usage

Lagniappe (lan yap’) n., a gift or bonus

Arranging CSS Styles

V Scripting, DHTML, and Other Dynamic Content

19 Using Dynamic Web Templates

An Introduction to Dynamic Web Templates

Creating a Dynamic Web Template

Creating a Page Layout

Adding Editable Regions

Attaching a Dynamic Web Template

Attaching to an Existing Page

Attaching to a New Page

Updating a Site with Dynamic Web Templates

Modifying a Dynamic Web Template

Modifying an Attached Page in Code View

Managing Editable Regions

Adding a New Editable Region

Renaming an Existing Editable Region

Resolving Mismatched Editable Regions

Detaching a Dynamic Web Template

Lagniappe (lan yap’) n., a gift or bonus

Under the Hood

20 Using Interactive Buttons

Overview of Interactive Buttons

Inserting and Configuring Interactive Buttons

The Button Tab

The Font Tab

The Image Tab

Saving an Interactive Button

Editing an Interactive Button

Lagniappe (lan yap’) n., a gift or bonus

Practical Uses for Interactive Buttons

21 Using Behaviors

Understanding and Working with Behaviors

Using the Behaviors Panel

How Behaviors Work

Adding Behaviors Within a Paragraph

Expression Web 3 Behaviors

The Call Script Behavior

The Change Property Behavior

The Change Property Restore Behavior

The Check Browser Behavior

The Check Plug-in Behavior

The Go To URL Behavior

The Jump Menu Behavior

The Jump Menu Go Behavior

The Open Browser Window Behavior

The Play Sound Behavior

The Popup Message Behavior

The Preload Images Behavior

The Set Text Behavior

The Swap Image Behavior

The Swap Image Restore Behavior

Detecting Browsers

Creating a Blank Page for Redirecting

Editing the Check Browser Code

22 Client-Side Scripting

A History of Browser Scripting

JavaScript Basics

Adding JavaScript to a Page

Linking to an External Script File

Adding Inline JavaScript

The Document Object Model

The window Object

The document Object

Writing Simple Scripts

Showing and Hiding Page Elements

Accessing and Changing Attributes

Form Field Validation

Lagniappe (lan yap’) n., a gift or bonus

Debugging

23 Using Layers

Introduction to Layers

Inserting and Configuring Layers

Adding Content to a Layer

Resizing a Layer

Creating and Working with Child Layers

Positioning Layers

Setting Layer Properties with Behaviors

Setting the Visibility of Layers

Adding Layer Interactivity

Lagniappe (lan yap’) n., a gift or bonus

Z-Order Anomalies

24 Using Form Controls

Understanding HTML Forms

Using Form Controls in Expression Web 3

Creating a Form

Saving Form Results to a File or Email

File Results Tab

Email Results Tab

Confirmation Page Tab

Saved Fields Tab

Saving Form Results to a Database

Updating a Database with New Fields

Lagniappe (lan yap’) n., a gift or bonus

Hidden Form Fields

VI ASP.NET and PHP Development

25 Using Standard ASP.NET Controls

ASP.NET: A Brief Introduction

Creating ASP.NET Pages

The Basics of ASP.NET Controls

Understanding Control Properties

An Overview of the Standard ASP.NET Controls

The AdRotator Control

Creating a Simple AdRotator Page

Creating the Advertisement File

The Calendar Control

Formatting the Calendar Control

Calendar Control Properties

The Wizard Control

Wizard Steps

Creating a Simple Wizard

Making ASP.NET Work for You

Lagniappe (lan yap’) n., a gift or bonus

Formatting with Styles

26 Using ASP.NET Navigation Controls

Overview of Navigation Systems

Creating a Sitemap File

Using the ASP.NET Menu Control

Creating a Test Site

Adding a Menu Control

Formatting the Menu Control

Using the ASP.NET TreeView Control

Formatting the TreeView Control

Using the ASP.NET SiteMapPath Control

Formatting the SiteMapPath Control

Lagniappe (lan yap’) n., a gift or bonus

Improving Navigation with Master Pages

27 Using ASP.NET Master Pages and User Controls

The Need For a Common Layout

The Master Page

The Content Page

Developing a Master Page Site

Creating the Master Page

Creating the Content Page

Lagniappe (lan yap’) n., a gift or bonus

Converting an Existing Site to a Master Page Site

28 Developing a Login System Using ASP.NET

Website Login Systems

Overview of ASP.NET Login Controls

The Login Control

LoginStatus Control

LoginName Control

ChangePassword Control

PasswordRecovery Control

CreateUserWizard Control

LoginView Control

Creating a Login Solution

Configuring the Website (IIS 5 or IIS 6)

Configuring the Website (IIS 7)

Configuring the Website (Microsoft Expression Development Server)

Creating the Web Pages

Lagniappe (lan yap’) n., a gift or bonus

Modifying Password Requirements

29 Form Validation Using ASP.NET

The Need for Form Validation

The ASP.NET Validation Controls

Common Properties

Creating a Validated Form

Lagniappe (lan yap’) n., a gift or bonus

Validation Groups

30 Using ASP.NET Web Parts

An Introduction to Web Parts

Creating ASP.NET User Controls

Web Parts Controls in the Toolbox

Creating a Web Parts Page

Web Parts Page Display Modes

Creating a User Control That Sets the Display Mode

Adding Code to Change the Display Mode

The Web Parts Catalog

Lagniappe (lan yap’) n., a gift or bonus

Editing Web Parts Controls

31 ASP.NET AJAX Extensions

What Is Ajax?

Microsoft’s ASP.NET AJAX

Client-side AJAX

Server-side AJAX

Microsoft AJAX Control Toolkit

Adding Ajax Functionality to a Web Form

Creating a Site and Page

Adding Server-side Code

Adding a ScriptManager Control

Adding an UpdatePanel Control

Lagniappe (lan yap’) n., a gift or bonus

Using Client-side AJAX

Adding a <div> to the Web Form

Creating the Client Library

Adding the Client Script to the ScriptManager Control

32 Using PHP

An Introduction to PHP

PHP Syntax

Installing PHP

Installing IIS 7 and FastCGI

Installing PHP

Configuring the Microsoft Expression Development Server for PHP

Enabling PHP for IIS Using FastCGI

Creating PHP Pages

Previewing the Page

PHP in Design View

PHP in Code View

PHP Syntax Highlighting

Using IntelliSense with PHP

Setting PHP-Specific IntelliSense Options

PHP Script Options

Form Variable

URL Variable

Session Variable

Cookie Variable

include

Include Once

require

require_once

Code Block

echo

Comment

if

else

Lagniappe (lan yap’) n., a gift or bonus

Displaying PHP Information

33 Using the Microsoft Expression Development Server

Introduction to the Microsoft Expression Development Server

How to Use the Microsoft Expression Development Server

Limitations of the Microsoft Expression Development Server

Process Identity

No Remote Access

No Support for ASP Pages

Lagniappe (lan yap’) n., a gift or bonus

Starting the Microsoft Expression Development Server from the Command Prompt

VII Managing Data with ASP.NET

34 Displaying and Editing Database Data with ASP.NET

A History of Data Access

Data Access Technologies in Expression Web 3

ASP.NET and Other Web Application Platforms

ASP.NET Data Source Controls

AccessDataSource Control

SqlDataSource Control

SiteMapDataSource Control

XmlDataSource Control

Displaying Data with ASP.NET

Displaying Data in Tabular Form

Sorting the GridView

Editing Data with ASP.NET

Configuring the Data Source

Configuring the GridView

Testing the Page

Lagniappe (lan yap’) n., a gift or bonus

Creating a Master/Detail View

Creating the Master View

Creating the Detail View

35 Sending Email Using ASP.NET (this chapter appears on the website only)

A Typical Contact Form

Creating the Contact Form

Adding and Configuring ASP.NET Validation Controls

Adding the Validation Controls

Writing ASP.NET Code to Send Email

Lagniappe: Displaying a Confirmation Page

Index

About the Author

Jim Cheshire is the owner of Jimco Software and Books and is the author of several design books and books on the Amazon Kindle. In his real job, Jim works as a senior escalation engineer at Microsoft on the ASP.NET and IIS teams. He has worked on the FrontPage, Visual Basic, ASP, IIS, and ASP.NET teams at Microsoft for more than 10 years.

You can reach Jim by visiting one of his websites: www.jimcobooks.com or www.jimcosoftware.com. You can also email him at [email protected].

Acknowledgments

I owe a debt of gratitude to my editors at Que Publishing. Loretta, it’s been such a pleasure to work with you over the years. Kevin, thanks for your consistent work to improve what comes out of my mind. To Megan and Kathleen, thank you for your hard work in ensuring that this book is technically accurate and easy to understand. To Tonya, thanks for your commitment to a quality book. Although the cover of this book bears my name only, the book would have not been possible without the commitment of all of you, and I am sincerely thankful for all your hard work.

To my mother and father, thank you so much for your confidence and love, and thanks for the “Lagniappe” idea, Dad. To Anna Ullrich, Paul Bartholomew, Justin Harrison, Steve Guttman, Erik Saltwell, and Mike Coleman at Microsoft, thank you for your help and support. Thank you, Lord, for my wonderful family and for this great country, where one can pursue one’s dreams in freedom.

—Jim

We Want to Hear From You!

As the reader of this book, you are our most important critic and commentator. We value your opinion and want to know what we’re doing right, what we could do better, what areas you’d like to see us publish in, and any other words of wisdom you’re willing to pass our way.

As an associate publisher for Que Publishing, I welcome your comments. You can email or write me directly to let me know what you did or didn’t like about this book—as well as what we can do to make our books better.

Please note that I cannot help you with technical problems related to the topic of this book. We do have a User Services group, however, where I will forward specific technical questions related to the book.

When you write, please be sure to include this book’s title and author as well as your name, email address, and phone number. I will carefully review your comments and share them with the author and editors who worked on the book.

Email:     [email protected]
Mail:      Greg Wiegand
               Associate Publisher
               Que Publishing
               800 East 96th Street
               Indianapolis, IN 46240 USA

Reader Services

Visit our website and register this book at informit.com/register for convenient access to any updates, downloads, or errata that might be available for this book.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.139.70.21