Top Banner
ASP.NET Seminar February 16, 2013
22

February 16, 2013. Aaron Cuffman [email protected] Andy Nagle [email protected] Adam Schultz [email protected] Web Site.

Dec 27, 2015

Download

Documents

Lydia McCormick
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

ASP.NETSeminar

February 16, 2013

Page 2: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

Aaron [email protected]

Andy [email protected]

Adam [email protected]

Web Sitehttp://www.bthreesolutions.com

Page 3: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

ObjectivesLearn the fundamentals of

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

Page 4: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

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

Page 5: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

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

Page 6: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

Introduction to ASP.NETAn adventure in TIME and SPACE!

Page 7: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

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

Page 8: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

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.

Page 9: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

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

Page 10: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

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

Page 11: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

Request PathTwo major roles. Client and ServerClient

Makes requests to the serverServer

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

Page 12: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.
Page 13: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

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

Page 14: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.
Page 15: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

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

Page 16: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

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

Page 17: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

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

Page 18: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

Control EventsButton Click, Checkbox Changed, Textbox

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

occur

Page 19: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

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

Page 20: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

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.

Page 21: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

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 22: February 16, 2013. Aaron Cuffman acuffman@bthreesolutions.com Andy Nagle anagle@bthreesolutions.com Adam Schultz aschultz@bthreesolutions.com Web Site.

Page Life CycleMuch more information on MSDN

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