designing & developing web-based solutions in asp.net

Post on 25-Feb-2016

29 Views

Category:

Documents

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

Designing & Developing Web-Based Solutions in ASP.NET. Week 1. Today’s Agenda. Course Overview Introductions Lab/Lecture: WebForms + Code Behind XML, web.config State Management Web Site Deployment Homework Description. Topic Schedule. Week 2Themes & Master Pages - PowerPoint PPT Presentation

TRANSCRIPT

1

Designing & Developing Web-Based Solutions in ASP.NET

Week 1

Today’s Agenda Course Overview Introductions Lab/Lecture:

WebForms + Code Behind XML, web.config State Management Web Site Deployment

Homework Description

Designing & Developing Web-Based Solutions in ASP.NET 2

Topic Schedule Week 2 Themes & Master Pages Week 3 Nav, Resources, Binding, Validation Week 4 User Controls, Files, Streams Week 5 Custom Server Controls Week 6 JavaScript, AJAX, Web Services Week 7 AJAX Toolkit, WCF, JQuery Week 8 Caching & Performance Week 9 Silverlight Week 10 Special Topics, DEMOS

Designing & Developing Web-Based Solutions in ASP.NET 3

Class Schedule 5:30-6:00 Office Hours 6:00 Review (Quiz answers) 6:15 Lecture/Lab 7:00 Break 7:10 Attendance 7:15 Lecture/Lab 8:00 Break 8:10 Assisted Lab 8:55-9:00 Assignment (posted on web)

Designing & Developing Web-Based Solutions in ASP.NET 4

Grading 80% Attendance Required!!!

Take home quizzes 50% Reading Videos & Online Tutorials

Class Website Project 50% Implement a topic from each week 10 features required + last day 2 Minute demo

Designing & Developing Web-Based Solutions in ASP.NET 5

Website Project Ideas Personal

Photo Album / Family Tree Interactive Resume

Small Business Employee/Client Tracker, eCommerce, Blog

Hobby Site Forum, Gadgets (special calculators)

Game / Fan Site Cards, Tic-tac-toe, Crossword, ww.Swirve.com style Sports stats, Interactive Little League Schedule

Designing & Developing Web-Based Solutions in ASP.NET 6

Introductions - Instructor Chuck Walters Education

BS Computer Science, UW ‘95 (comp E minor) ATA: Engineering Rendering ’90 (drafting & CAD) A&P: Airframe Mechanics ’89

Companies Electronic Arts, Wizards of the Coast, Tooned In,

Manley and Associates, Tektronix, Attachmate, The Whole Experience, Microsoft, Digini, Gamegineer

Designing & Developing Web-Based Solutions in ASP.NET 7

Introductions - Instructor C/C++/Asm

Games: Racing, FPS, Sports, … C# Projects

Game dev support tools, Magic the Gathering Online, Video Conferencing, Cribbage in Silverlight

Cell Brew arcade game, ProteinFolder cell web site

Web JNI, Swing, Java script, server monitors, …

Designing & Developing Web-Based Solutions in ASP.NET 8

Shipped Titles

Designing & Developing Web-Based Solutions in ASP.NET 9

Introductions – Students (2 min) Name Background (Education – Work)

Reason Attending Personal - work Most Interesting Topic

Web Site Project Idea

Designing & Developing Web-Based Solutions in ASP.NET 10

BASIC XML

Designing & Developing Web-Based Solutions in ASP.NET 11

XML Formatted Files Files formatted in XML

HTML WebForms

.aspx .ascx

web.config <MyMasterPage>.master

Designing & Developing Web-Based Solutions in ASP.NET 12

XML –Samples <Client></Client> // Begin & End <Client/> // Empty Node <Client Name=“Joe”/> // Attr only - Shortcut <!--Client></Client--> // Comment Out <Client Name=“Joe”> // Override if Attr set

<Name>Joe</Name> // Element of Client -// Default Format

<Address/> // empty, can remove with// XML, stays w/

SOAP</Client> Designing & Developing Web-Based Solutions in ASP.NET 13

WEB FORMSAnatomy Review

Designing & Developing Web-Based Solutions in ASP.NET 14

WebForms – The Basics WebForm + Code Behind

Webform xml template used to construct html page

CodeBehind Uses webform to render html page Handle events on the server

Filenames Webform = *.aspx Codebehind = *.aspx.cs

Designing & Developing Web-Based Solutions in ASP.NET 15

WebForm – Page Directive Page Directive

<% Page Language=“C#” CodeFile=“default.aspx.cs”AutoEventWireup=“true”Trace=“true” // On page debugging%>

Comments <%-- This is a comment --%> // different than xml

Designing & Developing Web-Based Solutions in ASP.NET 16

WebForm - DocType <!DOCTYPE html PUBLIC "-//W3C//DTD

XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> Browser Compatibility Features Compatibility Deprecated features XHTML compliance

Designing & Developing Web-Based Solutions in ASP.NET 17

WebForm - Content HTML

<head> <body> <form> <div> <br>

ASP.NET controls <asp:Label> <asp:Content> // Used with master pages

Designing & Developing Web-Based Solutions in ASP.NET 18

WebForm – Page Class Response Object

Query String Cookies URL entered Client Browser Specs Much More (Look at this in debugger)

State Objects View, Session, Application, Cache

User Object Covered next quarter (profiles, roles, security)

Designing & Developing Web-Based Solutions in ASP.NET 19

EVENTSCode Behind

Designing & Developing Web-Based Solutions in ASP.NET 20

Events Page

Init Load/Loaded

Also called on postback PreRender/Render Unload

Postback Events OnChanged OnClicked …

Designing & Developing Web-Based Solutions in ASP.NET 21

SERVER CONTROLSBasic Intro

Designing & Developing Web-Based Solutions in ASP.NET 22

Server Controls

Designing & Developing Web-Based Solutions in ASP.NET 23

Definition: runat=“server”

Basic Types HTML Controls (Simple wrap) Web Controls (Enhanced wrap) Rich Controls (Limited use custom controls) Validation Controls

STATE MANAGEMENTReview

Designing & Developing Web-Based Solutions in ASP.NET 24

State ManagementQuery String View State Cookie Session State App State

Deprecated Profiles Caching

Data String Serializable Strings All All Serializable All

LocationBrowser’s URL

Hidden field current page

ClientDisk or Memory

Server memory or database

Server memory

Server database

Server memory

LifetimeURL Browser Settable

Disk 0 - ∞Tunable Server

RebootPermanent Tunable

ScopePage Page, gone

when nav away

App Single User entire Site

All users on entire Site

Anything All users on entire Site

SecurityNo Encryption

supportNo Server

Client SentServer Server Server

PerformFAST!!!Limited Len

Slows with size - unbound

FAST!!!Limited Len

Bloat with # of users

Bloat Handles large data.Overhead

Tunable

UseProduct ID’s Temp page

settingsUser Preferences

Shopping cart

Global data Account Info

Database data

Designing & Developing Web-Based Solutions in ASP.NET 25

State Management – Accessors Common Get/Set design pattern

<State Type>[“Key”] Examples

ViewState[“myData”] = 1234; // Any Data TypeSession[“myData”] = 1234; // Any Data Type HttpCookie userPrefs =

Response.Cookies[“cookieName”]; String productName =

Request.QueryString[“product”];

Designing & Developing Web-Based Solutions in ASP.NET 26

State Management – ViewState Access

ViewState[someControl.ID] Controls automatically stored by ID (which is a string)

Stored as global base type: System.Object ViewState[“LuckyNum”] = 1234; // object array int luckyNum = (int)ViewState[“LuckyNum”]; // Cast

Enabled by default <%@ Page EnableViewState=“false” %>

Encryption off by default <%@ Page ViewStateEncryptionMode=“Always” %>

Designing & Developing Web-Based Solutions in ASP.NET 27

State Management – Query Str Format

Key / Value Element Access

Use Redirection Simple State

Login Name Product IDs Action

Designing & Developing Web-Based Solutions in ASP.NET 28

State Management - Cookies Lifetime settings On Disk or In Memory Compact setting Dealing with Disabled Cookies

Designing & Developing Web-Based Solutions in ASP.NET 29

WEB SITE DEPLOYMENTOverview

Designing & Developing Web-Based Solutions in ASP.NET 30

Website Deployment Location

FTP (preferred) Local IIS FrontPage Extensions

Multi-Site Virtual Directories Redirect (performance hit)

Designing & Developing Web-Based Solutions in ASP.NET 31

Website Deployment - Admin Domain Redirect

DNS1, DNS2, DNS… Permissions

Browsable directory Password protected

Designing & Developing Web-Based Solutions in ASP.NET 32

LABHands On

Designing & Developing Web-Based Solutions in ASP.NET 33

Lab Create a simple site

View files Web.config .aspx + codebehind + partial class (maintained by VS)

Debug Events Add Server Controls

Deploy site Set Trace on (per page) Custom Errors off (web.config)

View web host controls (webhost4life.com)

Designing & Developing Web-Based Solutions in ASP.NET 34

Homework Readings

Chapter 16 – Themes & Master Pages Reading Quiz due beginning of next class Review if needed (Ch 3 – Web Forms, Ch 6 – State)

Project Assignment Signup for webhosting

WebHost4Life.com $10 / month Signup for domain (optional yet recommended)

www.mydomain.com < $9 / year “Website Project” idea.

Write up simple page hierarchy & content

Designing & Developing Web-Based Solutions in ASP.NET 35

top related