Contents

Contents at a Glance

Contents

About the Author

About the Technical Reviewer

Acknowledgments

Introduction

Code Samples

Errata

Contacting the Author

Chapter 1: Introducing Microsoft WebMatrix

What is WebMatrix?

What is a Dynamic, Data-Driven Web Site?

Why Use WebMatrix?

The ASP.NET Platform

Who Should Use WebMatrix?

What Will I Learn?

The WebMatrix Community

Prerequisites

Previous Knowledge

System Requirements

Summary

Chapter 2: Getting Started

Installing WebMatrix

Getting WebMatrix If You Don’t Already Have the Web Platform Installer

Getting WebMatrix via the Web Platform Installer

What’s in the box?

Getting Started with WebMatrix Web Sites

Enter the Matrix: Creating Your First Site

Our First WebMatrix Application

The WebMatrix IDE: A Quick Tour

Adding a Page to Your Site

Working with the HTML

Adding Some Razor Code

Summary

Chapter 3: C# Primer

Types and Variables

Naming Identifiers

Booleans

Numbers

Strings

Dates and Times

Operators

Arithmetic Operators

Assignment Operators

Equality Operators

Relational Operators

Conditional Operators

Collections

Arrays

Generic Collections-

Conditions

if…else

switch

try…catch

Loops

The while loop

The do loop

The for loop

The foreach loop

Object Oriented Programming

Principles and Terminology

OOP Conclusion

Dynamics

ExpandoObject()

Summary

Chapter 4: Working with Razor and ASP.NET Web Pages

Razor Syntax

Adding a single line of server-side code

Adding more complex code

Mixing it up

Layout

RenderPage()

Layout Pages

RenderSection()

Making a section optional

Passing Data to Layout and Partial Pages

Helpers

Functions

Maintaining State

Session State

Cookies

Startup Code

Application Level Code

Folder Level Code

URLs and Routing

Routing

Passing Data in the URL

Summary

Chapter 5: Forms and Validation

HTML Forms

Form Controls

HTML Form Helpers

Html.TextBox(), Html.Password() and Html.Hidden()

Html.CheckBox()

Html.RadioButton()

Html.TextArea()

Html.DropDownList()

Html.ListBox()

Html.Label()

Handling Forms with WebMatrix

Identifying Form Submissions

Accessing Submitted Form Data

Validating User Input

When to validate?

Form Security

Performing Form Validation

Building a validation library

Summary

Chapter 6: Working with Data

SQL Server Compact Edition

Creating a Database

Interacting with Data

Fetching Data

Inserting Data

Updating Data

Deleting Data

Data Access with WebMatrix

Making the Connection

Retrieving and Displaying Data

Adding Records

Editing Existing Data

Deleting Records

Displaying Data with WebMatrix Helpers

The WebGrid Helper

The Chart Helper

Working with Other Databases

Migrating an SQL Server Database

Connecting to an SQL Server or MySQL Database

Summary

Chapter 7: Security and Membership

Setting Up the WebSecurity Helper

Creating a New User Registration Page

Adding an Account Summary Helper

Providing a Login Page

The Logout Page

Changing Passwords

Protecting Content

Restricting to Authenticated Users

Roles

Advanced Membership Features

Storing Additional User Information

Summary

Chapter 8: Using Web Helper Packages

Accessing the Package Manager

Installing a Package

The ASP.NET Web Helpers Library

Adding Search with Bing

Twitter

Facebook

Gravatar

Xbox Live Gamer Card

LinkShare

ReCaptcha

Analytics

Summary

Chapter 9: TechieTogs: An Example E-commerce Site

Getting Started

Page Layout

Adding a Database

Creating Tables to Store the Product Catalog

Adding Data to the Tables

Creating a Product Catalog

The Categories List

The Product Listings Page

The Product Details Page

Adding Social Networking Features

The Google +1 Helper Package

Adding Google +1, Twitter, and Facebook Buttons

Searching the Catalog

Custom Error Pages

Displaying a Default Error Page

404 – Not Found Errors

Summary

Chapter 10: TechieTogs: Adding E-commerce Features

The Shopping Process

The Shopping Cart

Defining the Cart Class

The Shopping Cart Page

User Accounts

Why Bother?

Initializing the Membership System

Registering New Accounts

The Account Summary Helper

The Login Page

The Logout Page

The Change Password Page

Forgotten Passwords

The Checkout Process

Preparing the Database

The Checkout Page

The Order Complete Page

Summary

Chapter 11: TechieTogs: Site Administration and Finishing Touches

Creating an Admin Area

Creating the Admin Role

Creating and Securing the Admin Folder

The Site Administration Home Page

The Admin Layout Page

The Admin Menu

The Admin Stylesheet

The Site Administration Home Page

Amending the Account Summary Helper

User Administration

Orders Administration

The Orders Summary Page

The Order Details Page

Product Categories

Editing Categories

Deleting Categories

Product Administration

The Products Summary Page

The Product Details Page

Adding Product Images

Displaying Product Images

Displaying Dynamic Content on the Home Page

Displaying a ‘Featured Product’

Popular Products

Summary

Chapter 12: Working with Images and Video

Working with Images

Uploading Images

Resizing Images

Cropping Images

Flipping and Rotating Images

Adding Watermarks to Images

Working with Video

Embedding Flash Video

Embedding Windows MediaPlayer Video

Embedding Microsoft Silverlight Video

Summary

Chapter 13: Debugging, Caching, and Deployment

Debugging ASP.NET Web Pages

Displaying Server Information

Displaying Object Information

Output Expressions

Browser Debugging Tools

Analyzing HTTP Requests

Debugging with Microsoft Visual Studio

Improving Performance Using Caching

Search Engine Optimization (SEO) with WebMatrix

The Performance Report

Analyzing Other Web Sites

Deploying Your Web Site

Finding a Hosting Provider

Publish Settings

Configuring External Database Connections

Publishing Your Web Site

Summary

Index

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

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