Building Effective Web Applications with ASP .Net 3.5


5 Νοε 2013 (πριν από 4 χρόνια και 8 μήνες)

96 εμφανίσεις

Building Effective Web
Applications with ASP .Net 3.5

Noah Subrin

SRA University

Fall 2008

Week 1

Course Schedule and Format


Every Thursday 08:30 to 10:30

October 23 through December 4

No class the week of November 24

Course Format

Presentations, Demos, Code
Walkthroughs, White Papers, Course
Text, Virtual Labs

Target Audience

Prior web development experience

Best geared towards programmers,
software engineers, web designers,
technical leads, task leads and

Class will be taught using C# which
has a similar syntax to Java

Instructor Introduction

Technical Lead (IRS JOC

MCSD and MCSD .Net

Represent SRA at developer
community events in the Southeast

Author of five prior SRA
U courses

Contact info:

Course Objectives

Become familiar with new features
in ASP .Net 3.5

Build database driven apps using

Leverage ASP .Net AJAX on both the
client and server side

Learn about state management and

Secure your ASP .Net websites

Create an end to end web app

Course Roadmap

Week 1

Getting Started

Week 2

Data Access, ADO .Net and

Week 3


Week 4

State Management and

Week 5


Week 6

End to End app and SP1

Course Text and Code Samples

ASP .Net 3.5 Unleashed ( author
Stephen Walther


Code samples available for download at

CD that accompanies the book has
both C# and VB .Net versions of the

Chapter 1 is available as a free
download from

Demo how to run book code

Today’s Agenda

Getting Started

Tools We Will Use

ASP .Net 3.5 Overview

Project Setup/Configuration

WebForms Overview

Server Controls

User Controls

Master Pages

Debugging and Tracing

New Features in ASP .Net 3.5

ASP .Net 3.5 Overview

ASP .Net 3.5 is a technology that
allows programmers to create dynamic
web sites.

ASP .Net can be used to create small
personal web sites or Enterprise

ASP .Net is part of the .Net

.Net Framework consists of the
Framework Class Library and the
Common Language Runtime

Tools We Will Use

VS 2008 Professional or

Visual Web Developer 2008

SQL Server Express Edition or higher
(2005 or 2008)

Express Edition or higher

Links to download these products can
be found on

VS2008 available from MS, MSDN or
Team System subscription or contact
Bill Scherer Jr

(SRA Enterprise
Solutions Tech Director)

Working with .Net Projects


VS2003: Single solution file. Project precompiled
into a single DLL, ASPX markup pages deployed.


Compiles/debugs like other projects (WinForms,

Slightly more efficient.

Single file deployment + referenced DLLs +


Not easy to use in team environments.

Often leads to monolithic DLLs for large sites.

Working with Projects


VS2005: Website Compilation Model

All files
compiled on demand.


Works better in teams.

Easy to deploy/test incremental updates.


Can be difficult to upgrade from VS2003.

First hit incurs compilation overhead.

May mean more files to deploy.

Working with Projects


VS2008: Both models supported
out of the box.

> New
> Web Site

Old style

New style

New style

New style

> New
> Project

> ASP.NET Web App

> New
> Web Site


Create a new website using ASP
.Net 3.5 and VS2008

Web Forms Key Points

ASPX pages handled by a handler that
facilitate the page lifecycle and events
(such as Page_Load, PreRender, and
control events).

Uses ViewState to encoded state
information otherwise lost in the stateless
nature of HTTP.

Extensive controls library to abstract
functionality. Buttons, textboxes, etc.


Web Forms have a .aspx file extension.

Server Controls

Typically compiled into a DLL.

Represents a small piece of
functionality, like a textbox or

Responsible for handling any special
rendering requirements, raising
events, etc.


Event Handlers

User Controls

Collections of HTML and/or Server
Controls for a broader purpose

such as a login dialog box.

Typically part of a project and
compiled with the project.

Can expose properties.

HTML Controls

Take any HTML tag and add a
runat=“server” tag.

This converts the HTML tag into a
side ASP .Net control

Allow us to program server side

Master Pages

Same look and feel to many pages;
code in one spot.


We will look at some other Demos
after break

ViewState (p29)

The HTTP Protocol is a stateless

Web Pages use a
Request/Response model

ViewState allows us to save the
state of a server control across
multiple page requests

Comes with performance overhead

Enabled by default for each control


Add page level tracing to existing

Examine page lifecycle

Examine Viewstate cost

Write to trace log

We can determine if the page is
posting back by using the
Page.IsPostback property

We can turn tracing and debugging
on at the page or app level

Dynamic Compilation (p35)

When we create an ASP .Net page
we are creating source code for a
.Net class

Pages are compiled and stored in a
temp folder on the web server

Unlike classic ASP the page will not
be recompiled again, unless we
disable dynamic compilation

This allows support for thousands of
simultaneous users

Code Behind vs Single File Pages

In a single file ASP .Net page, a
single file contains both the page
code and page controls

A code behind has the page code in
a separate file

Which should you use? (p45)

New Features of VS2008

Javascript Intellisense/Debugging

Nested Master Pages

Enhanced CSS Management

targeting support.

New data controls.

MUCH improved designer.

Other ASP .Net Resources

MSDN Web site

MSDN Virtual Labs

MS Tech
ED Developer
presentations on my SRA portal site

VS 2008 Training Kit

Optional Take Home Class Exercise

MSDN Virtual Lab “Building web
Applications with Visual Studio

Event ID: 1032360368


This lab is included in the VS2008
Training Kit mentioned on previous
slide so this can be done offline on
your pc workstation

Next Week


Week 1 Review

Homework Review (Take home lab)

Chapters 16
18 (Data Access, ADO
.Net, and LINQ to SQL)

Questions ?

Feel free to contact me at

Please use the class portal site on
the SRA portal to post question or
other discussions that may be of
interest to the class.

Thank you!