february 16, 2013. aaron cuffman [email protected] andy nagle [email protected]...

22
ASP.NET Seminar February 16, 2013

Upload: lydia-mccormick

Post on 27-Dec-2015

213 views

Category:

Documents


0 download

TRANSCRIPT

ASP.NETSeminar

February 16, 2013

Aaron [email protected]

Andy [email protected]

Adam [email protected]

Web Sitehttp://www.bthreesolutions.com

ObjectivesLearn the fundamentals of

Server-client relations and Page eventsSate managementControls and LayoutsDatabindingJavaScript and ASP.NET

ProceduresSeminar will consist of 5 Lessons & 5 LabsLabs are designed for individuals

Group work will be accommodatedEach Lab is self contained

If you are unable to complete a lab or partial seminar attendance occurs; labs can be completed on your own

Next lab will not require prior lab completionOpen Conversation

Object is to help you learn the material

Agenda9:00 – 9:30 Lesson 1: Introduction to ASP.NET9:30 – 10:00 Lab 210:00 – 10:30 Lesson 2: State Management10:30 – 10:45 Break10:45 – 11:15 Lesson 3: Standard SQL11:15 – 11:45 Lab 211:45 – 12:30 Break12:30 – 1:00 Lesson 3: Controls1:00 – 1:30 Lab 31:30 – 2:00 Lesson 4: Data Binding2:00 – 2:30 Lab 42:30 – 3:00 Lesson 5: JavaScript 3:00 – 3:30 Lab 53:30 – 4:00 Wrap Up

Introduction to ASP.NETAn adventure in TIME and SPACE!

What is ASP.NET?Web Application framework

Used in building dynamic web pagesBuilt on CLR

You can write ASP.NET code in any .NET language

C#, VB, etc. http://en.wikipedia.org/wiki/List_of_CLI_languages

What is ASP.NET?Gives the “feel” of building a WinForm/WPF

style page, but with web pagesCan be misleading if you haven’t seen the page

life cycle [EPIC FORECHADOWING] which we will cover soon.

Design vs Code BehindASPX (Design) and .CS/.VB (Code Behind)Separates display from business logic

Makes it easy to have multiple people working on the same page

Designer working on the designer pageProgrammer working on the Code Behind

Not restricted to using Visual StudioEx: Blend http://msdn.microsoft.com/en-us/library/windows/apps/jj129478.aspx

Design vs Code BehindASPX page

The “designer” view. This describes the layout of the page

Code Behind PageResponds to events from the designer viewPage logic goes here

Redraw the page, make new queries, show/hide page sections

Request PathTwo major roles. Client and ServerClient

Makes requests to the serverServer

Turns requests into HTML pages (or files, or media)

Page Life CycleOnce a server receives a request for a page,

it needs to render that pageTakes the ASPX file plus the code for the

events and turns them into HTML

Pre InitRaised after the start stage is complete and

before the initialization stage begins.Used to:

Create dynamic controlsSet master pageSet themesInitialize page content before Init

InitRaised after all controls have been initialized

and any skin settings have been appliedThe Init event of individual controls occurs

before the Init event of the page.Used to:

Initialize controls before LoadLast chance to do anything before the

ViewState is loaded

LoadThe Page object calls the OnLoad method on

the Page object, and then recursively does the same for each child control until the page and all controls are loaded.

Used to:Set Properties for controlsEstablish Database Connections“ready” your page

Control EventsButton Click, Checkbox Changed, Textbox

Changed, etc.These events are processed in the order they

occur

Pre RenderRaised after the Page object has created all

controls that are required in order to render the page

Last chance to change anything before rendering the page

RenderThis is not an event; instead, at this stage of

processing, the Page object calls this method on each control.

Turns Controls into markup to send to the browser

If you create a custom control, you typically override this method to output the control's markup.

UnloadRaised for each control and then for the

page.Used as final cleanup for controlsAt the end of this process, the page is

destroyed.During the unload stage, the page and its

controls have been rendered, so you cannot make further changes to the response stream.

Page Life CycleMuch more information on MSDN

http://msdn.microsoft.com/en-us/library/ms178472(v=vs.100).aspx