Dev Basics: The ASP.NET Page Life Cycle

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    2 Favorites

    Dev Basics: The ASP.NET Page Life Cycle - Presentation Transcript

    1. ASP.NET Page Life Cycle Dev Basics Series Jay Harris
    2. About the Talk Covers Life Cycle Discuss: Data Binding ASP.NET Page Life Cycle Tips & Tricks Proper use of Data Binding Events Pain Points Involves only ASP.NET Events No MVC. No Silverlight. No Controls or DataSource Controls Tips & Tricks. And Traps. Overview What to expect out of this session
    3. About the Speaker Covers Life Cycle Jay Harris Data Binding Software Consultant Tips & Tricks .NET Developer Pain Points Ask Questions Anytime Please Give Feedback! http://www.speakerrate.com/jayharris/ Overview What to expect out of this session
    4. The Agenda Anatomy of the ASP.NET Page Life Cycle
    5. Page Start Agenda Start System Assigns Properties: Request Response UICulture System determines if the request is new or postback The Agenda Anatomy of the ASP.NET Page Life Cycle
    6. Page Initialization Agenda Start System Prepares Controls: Initialization Available by UniqueID Properties set from code/CIF values Applies Theme & MasterPage Handled in PreInit The Agenda Anatomy of the ASP.NET Page Life Cycle
    7. Page Load Agenda Start If IsPostBack: Initialization Restores Properties from State Load The Agenda Anatomy of the ASP.NET Page Life Cycle
    8. Render Agenda Start Saves ViewState & Renders Initialization Load Render The Agenda Anatomy of the ASP.NET Page Life Cycle
    9. Control Validation Agenda Start If IsPostBack & Validators exist: Initialization Runs Validate() for All Validators Load …even the disabled ones Validation Render The Agenda Anatomy of the ASP.NET Page Life Cycle
    10. PostBack Events Agenda Start If IsPostBack: Initialization Runs any Event Handlers as needed Load Validation Includes events such as: Events Render TextBox.TextChanged DropDownList.SelectedIndexChanged Button.Click The Agenda Anatomy of the ASP.NET Page Life Cycle
    11. Easy to Remember Agenda Start Initialization Load Validation “SILVER!” Events (as in medals & bars) Render The Agenda Anatomy of the ASP.NET Page Life Cycle
    12. Easy to Remember Agenda Start Load Initialization Validation Wait. “SLIVER?!?” Events (no, not wood) Render The Agenda Anatomy of the ASP.NET Page Life Cycle
    13. Easy to Remember Agenda Start Load Initialization Validation Huh? “LIVER?!?” Events (eww. gross. and there’s no onions) Render The Agenda Anatomy of the ASP.NET Page Life Cycle
    14. Easy to Remember Agenda Start Initialization Load Validation “Hi-yo, Silver, away!” Events (The Lone Ranger) Render The Agenda Anatomy of the ASP.NET Page Life Cycle
    15. Running the Show Harnessing the ASP.NET Page Life Cycle*
    16. Subjected to the terms, Running the Show limitations, availability, whims, will, desires, rules, patterns, provisions, agreements, covenants, conditions, assigns, Harnessing the ASP.NET Page Life Cycle* successors, and approval of the ASP.NET worker process.
    17. Debugging Events Features Page-Level Tracing: Tracing Page-Level <%@ Page Trace=“true” %> Running the Show Harnessing the ASP.NET Page Life Cycle*
    18. Debugging Events Features Page-Level Tracing: Tracing* Page-Level* <%@ Page Trace=“true” %> *Not available after Render Subjected to the terms, Running the Show limitations, availability, whims, will, desires, rules, patterns, provisions, agreements, covenants, conditions, assigns, Harnessing the ASP.NET Page Life Cycle* successors, and approval of the ASP.NET worker process.
    19. Debugging Events Features Application-Level Tracing: Tracing* Page-Level* App-Level <configuration> <system.web> <trace enabled=“true” /> </system.web> </configuration> Running the Show Harnessing the ASP.NET Page Life Cycle*
    20. Debugging Events Features Application-Level Tracing: Tracing* Page-Level* App-Level* <configuration> <system.web> <trace enabled=“true” /> </system.web> </configuration> *Site-Wide Performance Hit Subjected to the terms, Running the Show limitations, availability, whims, will, desires, rules, patterns, provisions, agreements, covenants, conditions, assigns, Harnessing the ASP.NET Page Life Cycle* successors, and approval of the ASP.NET worker process.
    21. Event Wiring Features Using the Constructor: Tracing* Wiring Manual public MyPage() { this.Load += PageLoad; } protected void PageLoad(…) Running the Show Harnessing the ASP.NET Page Life Cycle*
    22. Event Wiring Features Using the Constructor: Tracing* Wiring* Manual* public MyPage() { this.Load += PageLoad; } protected void PageLoad(…) *Wire Control events in Page Init Subjected to the terms, Running the Show limitations, availability, whims, will, desires, rules, patterns, provisions, agreements, covenants, conditions, assigns, Harnessing the ASP.NET Page Life Cycle* successors, and approval of the ASP.NET worker process.
    23. Event Wiring, Auto Features Auto-Wire via Page_EventName: Tracing* Wiring* Manual* protected void Page_Load(…) Auto-Wire { //Do some stuff } Running the Show Harnessing the ASP.NET Page Life Cycle*
    24. Event Wiring, Auto Features Auto-Wire via Page_EventName: Tracing* Wiring* Manual* protected void Page_Load(…) Auto-Wire* { //Do some stuff } *Page only. Not for controls. *Performance Hit. Subjected to the terms, Running the Show limitations, availability, whims, will, desires, rules, patterns, provisions, agreements, covenants, conditions, assigns, Harnessing the ASP.NET Page Life Cycle* successors, and approval of the ASP.NET worker process.
    25. Event Execution Features Top-Down Control Tree Execution Tracing* Wiring* Execution First load the Page Tree …then load the Container Control …then load the Child Control Running the Show Harnessing the ASP.NET Page Life Cycle*
    26. Event Execution Features Top-Down Control Tree Execution Tracing* Wiring* Execution* First load the Page Tree* …then load the Container Control …then load the Child Control *Except: Initialization & Unload First unload Controls, then the Page Subjected to the terms, Running the Show limitations, availability, whims, will, desires, rules, patterns, provisions, agreements, covenants, conditions, assigns, Harnessing the ASP.NET Page Life Cycle* successors, and approval of the ASP.NET worker process.
    27. Event Execution Features Index-based Collection Execution Tracing* Wiring* Execution* page.Controls[0].OnLoad Tree* page.Controls[1].OnLoad Collection page.Controls[2].OnLoad … page.Controls[n].OnLoad Running the Show Harnessing the ASP.NET Page Life Cycle*
    28. Event Execution Features Index-based Collection Execution Tracing* Wiring* Execution* page.Controls[0].OnLoad Tree* page.Controls[1].OnLoad Collection* page.Controls[2].OnLoad … page.Controls[n].OnLoad * When was it added to Controls? Subjected to the terms, Running the Show limitations, availability, whims, will, desires, rules, patterns, provisions, agreements, covenants, conditions, assigns, Harnessing the ASP.NET Page Life Cycle* successors, and approval of the ASP.NET worker process.
    29. Event Execution Features Index-based Collection Execution Tracing* Wiring* Execution* page.Controls[0].OnLoad Tree* page.Controls[1].OnLoad Collection* page.Controls[2].OnLoad … page.Controls[n].OnLoad * When was it added to Controls? Subjected to the terms, Running the Show limitations, availability, whims, will, desires, rules, patterns, provisions, agreements, covenants, conditions, assigns, Harnessing the ASP.NET Page Life Cycle* successors, and approval of the ASP.NET worker process.
    30. Loading ViewState Features Control State is loaded twice Tracing* Wiring* Execution* Once immediately prior to Load ViewState Once immediately following Load Running the Show Harnessing the ASP.NET Page Life Cycle*
    31. Loading ViewState Features Control State is loaded twice Tracing* Wiring* Execution* Once immediately prior to Load ViewState* Once immediately following Load *Not restored if modified prior Subjected to the terms, Running the Show limitations, availability, whims, will, desires, rules, patterns, provisions, agreements, covenants, conditions, assigns, Harnessing the ASP.NET Page Life Cycle* successors, and approval of the ASP.NET worker process.
    32. Displaying Data Effectively Binding Dynamic Data to the Page
    33. DataBind(); Data DataBind(); Control.DataBind(); Only for the specific contol and its child controls Page.DataBind(); Binds all controls on the page Displaying Data Effectively Binding Dynamic Data to the Page
    34. Binding Events Data DataBind(); DataBinding Events Begins DataBinding of a control DataBinding Displaying Data Effectively Binding Dynamic Data to the Page
    35. Binding Events Data DataBind(); RowCreated / ItemCreated Events Manipulating item markup DataBinding Cannot be dependent on control data RwCreated Row vs. Item Usage: RowCreated: GridView ItemCreated: DataGrid,ListView, Repeater, and everything else. Displaying Data Effectively Binding Dynamic Data to the Page
    36. Binding Events Data DataBind(); RowDataBound / ItemDataBound Events Manipulating item data DataBinding Data is available within controls RwCreated RwDBound Row vs. Item Usage: RowCreated: GridView ItemCreated: DataGrid, ListView, Repeater, and everything else. Displaying Data Effectively Binding Dynamic Data to the Page
    37. Resources & Questions Resources MSDN: http://tinyurl.com/AspNetPageLifeCycle Blog: http://www.cptloadtest.com Twitter: @jayharris Questions? Wrap-up Taking the Next Steps with the ASP.NET Page Life Cycle
    38. Thank You Jay Harris Online Blog: http://www.cptloadtest.com Twitter: @jayharris Feedback Rate: http://www.speakerrate.com/jayharris Wrap-up Taking the Next Steps with the ASP.NET Page Life Cycle

    + Jay HarrisJay Harris, 4 months ago

    custom

    784 views, 2 favs, 0 embeds more stats

    When a request occurs for an ASP.Net page, the resp more

    More info about this document

    © All Rights Reserved

    Go to text version

    • Total Views 784
      • 784 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 2
    • Downloads 0
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as inappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel
    File a copyright complaint
    Having problems? Go to our helpdesk?

    Categories