350 likes | 460 Views
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 2 Themes & Master Pages
E N D
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
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
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
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
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
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
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
Shipped Titles Designing & Developing Web-Based Solutions in ASP.NET
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
Basic XML Designing & Developing Web-Based Solutions in ASP.NET
XML Formatted Files • Files formatted in XML • HTML • WebForms • .aspx • .ascx • web.config • <MyMasterPage>.master Designing & Developing Web-Based Solutions in ASP.NET
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
Anatomy Review Web Forms Designing & Developing Web-Based Solutions in ASP.NET
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
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
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
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
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
Code Behind Events Designing & Developing Web-Based Solutions in ASP.NET
Events • Page • Init • Load/Loaded • Also called on postback • PreRender/Render • Unload • Postback Events • OnChanged • OnClicked • … Designing & Developing Web-Based Solutions in ASP.NET
Basic Intro Server Controls Designing & Developing Web-Based Solutions in ASP.NET
Server Controls Designing & Developing Web-Based Solutions in ASP.NET • Definition: • runat=“server” • Basic Types • HTML Controls (Simple wrap) • Web Controls (Enhanced wrap) • Rich Controls (Limited use custom controls) • Validation Controls
Review State Management Designing & Developing Web-Based Solutions in ASP.NET
State Management Designing & Developing Web-Based Solutions in ASP.NET
State Management – Accessors • Common Get/Set design pattern • <State Type>[“Key”] • Examples • ViewState[“myData”] = 1234; // Any Data Type • Session[“myData”] = 1234; // Any Data Type • HttpCookieuserPrefs = Response.Cookies[“cookieName”]; • String productName = Request.QueryString[“product”]; Designing & Developing Web-Based Solutions in ASP.NET
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 • intluckyNum = (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
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
State Management - Cookies Lifetime settings On Disk or In Memory Compact setting Dealing with Disabled Cookies Designing & Developing Web-Based Solutions in ASP.NET
Overview Web Site Deployment Designing & Developing Web-Based Solutions in ASP.NET
Website Deployment • Location • FTP (preferred) • Local • IIS • FrontPage Extensions • Multi-Site • Virtual Directories • Redirect (performance hit) Designing & Developing Web-Based Solutions in ASP.NET
Website Deployment - Admin • Domain Redirect • DNS1, DNS2, DNS… • Permissions • Browsable directory • Password protected Designing & Developing Web-Based Solutions in ASP.NET
Hands On Lab Designing & Developing Web-Based Solutions in ASP.NET
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
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