Server Control Tips & Tricks Presented by: Patrick Hynds Microsoft Regional Director CriticalSites CTO MCSD, MCSE+I, MCDBA, MCSA, MCP+Site Builder, MCT.

Slides:



Advertisements
Similar presentations
Unit 02. ASP.NET Introduction HTML & Server controls Postbacks Page Lifecycle.
Advertisements

ASP.NET Page Life Cycle Dev Basics Series Jay Harris.
Master Pages, User Controls, Site Maps, Localization Svetlin Nakov Telerik Corporation
Web Forms and ASP.NET Programming Right from the Start with Visual Basic.NET 1/e 12.
11 ASP.NET Slides based off:. 22 B ACKGROUND - W EB A RCHITECTURE Web Server PC/Mac/Unix/... + Browser Client Server Request:
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Asp.NET Core Server Controls. Slide 2 Lecture Overview Understanding the types of ASP.NET controls HTML controls ASP.NET (Web) controls.
Anatomy of an ASP.NET Page. Slide 2 My Version of the Big Picture (1) ASP Worker (Engine) Your application Runs Server Other applications User 1User 2.
1 Chapter 12 Working With Access 2000 on the Internet.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 1.1 of…
Chapter 12: ADO.NET and ASP.NET Programming with Microsoft Visual Basic.NET, Second Edition.
Web Platform Introduction With a focus on “free” Mike Taulty Developer & Platform Group Microsoft Ltd
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 3-1 of…
Introduction to ASP.NET, Second Edition2 Chapter Objectives.
Introduction to ASP.NET
Computer Science 101 Web Access to Databases Overview of Web Access to Databases.
Developing an ASP.NET Application and using the Mobile Internet Toolkit Bart Vande Ghinste Developer Consultant Microsoft Belux.
Christopher M. Pascucci Basic Structural Concepts of.NET Browser – Server Interaction.
Web Forms. Agenda Web forms Web controls Code separation Dynamic compilation System.Web.UI.Page User controls.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
OOP and Web Applications Michael Juřek Architect Evangelist Microsoft Corporation.
A Scalable Application Architecture for composing News Portals on the Internet Serpil TOK, Zeki BAYRAM. Eastern MediterraneanUniversity Famagusta Famagusta.
JavaScript & jQuery the missing manual Chapter 11
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Building a UI with Zen Pat McGibbon –Sales Engineer.
AJAX in ASP.NET James Crowley Developer Fusion
February 16, Aaron Cuffman Andy Nagle Adam Schultz Web Site.
Overview of Previous Lesson(s) Over View  ASP.NET Pages  Modular in nature and divided into the core sections  Page directives  Code Section  Page.
© 2008 Dr. Paul Walcott – The University of the West Indies: Cave Hill CampusDr. Paul Walcott COMP6325 Advanced Web Technologies Dr. Paul Walcott The University.
ASP.Net Web Applications. Characteristics of a typical data driven web application Web Server HTML Graphics Active-X Java Applets HTTP Request ADO / JDBC.
Web Development Using ASP.NET CA – 240 Kashif Jalal Welcome to week – 4-1 of…
Creating Web Applications Using ASP.NET Chapter Microsoft Visual Basic.NET: Reloaded 1.
Web Programming: Client/Server Applications Server sends the web pages to the client. –built into Visual Studio for development purposes Client displays.
© Minder Chen, ASP.NET 2.0: Introduction - 1 ASP.NET 2.0 Minder Chen, Ph.D. Framework Base Class Library ADO.NET: Data & XML.
ASP.NET Controls. Slide 2 Lecture Overview Identify the types of controls supported by ASP.NET and the differences between them.
Introduction to ASP.NET 1www.tech.findforinfo.com.
Section 17.1 Add an audio file using HTML Create a form using HTML Add text boxes using HTML Add radio buttons and check boxes using HTML Add a pull-down.
Murach’s ASP.NET 4.0/VB, C1© 2006, Mike Murach & Associates, Inc.Slide 1.
© FPT SOFTWARE – TRAINING MATERIAL – Internal use 04e-BM/NS/HDCV/FSOFT v2/3 Unit 3: Adding Code to a Microsoft ASP.NET Web Form.
Overview of Previous Lesson(s) Over View  SDI programs  The Application Wizard can generate single-document interface (SDI) applications that work.
Anatomy of an ASP.NET Page. Slide 2 Compiling an ASP.NET Page An ASP.NET page is compiled when it is rendered for the first time A page is compiled to.
PV247 – Development I Introduction to ASP.NET and related technologies.
Microsoft ® Visual Studio.NET Presented by Joseph J. Sarna Jr., MCSD JJS Systems, LLC.
Module 4: Creating a Microsoft ASP.NET Web Form. Overview Creating Web Forms Using Server Controls.
Module 1: Working with ASP.NET. Overview Introducing ASP.NET Creating Web Forms Adding ASP.NET Code to a Page Handling Page Events Discussion: ASP vs.
Beginning ASP.NET (Part 3).NET 2.0 Core Libraries Tuc Goodwin.
VITALE, CATURANO & COMPANY LTD Microsoft SharePoint Web Part Development Overview VITALE, CATURANO & COMPANY LTD SharePoint Developer Series – Web Part.
Sofia, Bulgaria | 9-10 October ASP.NET: Developing Portal UI With Web Parts Goksin Bakir Yage Ltd Microsoft Regional Director, MEA Goksin Bakir Yage Ltd.
Server-side Programming The combination of –HTML –JavaScript –DOM is sometimes referred to as Dynamic HTML (DHTML) Web pages that include scripting are.
Christopher M. Pascucci.NET Programming CodeBehind.
The Problem of State. We will look at… Sometimes web development is just plain weird! Internet / World Wide Web Aspects of their operation The role of.
DEV401 Developing ASP.NET Server Controls - Part II: Adv Topics Tony Goodhew Product Manager Microsoft Corp.
ASP.NET 4 Unleashed Chapter 1. .aspx page: contains C# script and HTML code including tags. Listing 1.1 FirstPage.aspx.
BlackBerry Applications using Microsoft Visual Studio and Database Handling.
Module 4: Creating a Web Application with Web Forms
Asp.NET Core Server Controls. Slide 2 Lecture Overview Understanding the types of ASP.NET controls HTML controls ASP.NET (Web) controls.
Overview of Previous Lesson(s) Over View  ASP is a technology that enables scripts in web pages to be executed by an Internet server.  ASP.NET is a.
PostBack  When an initial request for a page (a Web Form) is received by ASP.NET, it locates and loads the requested Web Form (and if necessary compiles.
Building Custom Controls with ASP.NET and the Microsoft ®.NET Framework Rames Gantanant Microsoft Regional Director, Thailand
Event Handling & Viewstate CS 351 Ed Gellenbeck. Today Review of Web Forms ASP.NET Object Hierarchy Events State Management Page State Session State Application.
Introduction to ASP.NET development. Background ASP released in 1996 ASP supported for a minimum 10 years from Windows 8 release ASP.Net 1.0 released.
Sergey Sidorov PhD student, computer software chair Computer Science department.
ASP.NET Architecture Mike Taulty Developer & Platform Group Microsoft Ltd
Developing GIS WebParts in SharePoint
Displaying Form Validation Info
Anatomy of an ASP.NET Page
CIS16 Application Development Programming with Visual Basic
ASP.NET 4.0 State Management Improvements – Deep Dive
Web Development Using ASP .NET
Presentation transcript:

Server Control Tips & Tricks Presented by: Patrick Hynds Microsoft Regional Director CriticalSites CTO MCSD, MCSE+I, MCDBA, MCSA, MCP+Site Builder, MCT

Agenda Brief Overview Render & Control Lifecycle Adding Confirm to a Button Scrollable Datagrid Composite Controls Dynamic Template Loading Debugging Controls

What Is An ASP.NET Control? Defined: –Server-side Web component –… but not limited to UI A server control is a class –Exposes properties, methods, events –Logic is encapsulated Derived from –System.Web.UI.Control or –System.Web.UI.WebControls.WebControl

Tag-Based Persistence Tags parsed at runtime –Create control instance –Set initial property values first item first item second item second item third item third item Class to create Marks tag as a server control Namespace reference ID of the instance Sets the liststyle property on l1 Sets the Items property on l1

Page/Control Processing First load Init Load PreRender SaveViewState Render Dispose Each control instantiated, set to initial state, added to control tree User code runs, tests !IsPostBack condition to data bind 1 st values CreateChildControls() ensures controls are ready to render Controls save current state (if different than initial values) Each control renders itself to the Response Pages and all controls are disposed

Page/Control Processing Post back Init Load PreRender SaveViewState Render Dispose Last state of the controls is restored from ViewState values Posted data (in the HTTP form) is passed to its associated control Events are fired for controls in tree order, except the event that caused the post. It’s fired last. LoadViewState Postback data Postback events

Render & Control Lifecycle Problem –How do you output UI Render is the dominant method –Generated output of the control –Override to control output Control Tree in Page –Everything is a control (including Page) –Control tree built and walked to output

Control Rendering Simple Control, EventLog

Confirm/Alert Button Problem –Confirm user actions –Instruct with expected behavior JavaScript pop-up dialog –Confirm user action –Alert user to information Derive from Button –Add Properties for confirm/alert –Use Attributes property

Confirm/Alert Button

Derive from Base Controls Problem –Existing functionality already built –Don’t want to ‘re-invent the wheel’ Derive from ASP.NET server controls –Add functionality or behavior –Add new properties Override Render –Base.Render –Render out derived control

ScrollableDataGrid Problem –Lots of data in DataGrid –Don’t want to scroll browser ScrollableDataGrid control –Composite control that wraps DataGrid –Simply adds tag Great candidate for a server control –Cleaner HTML –No messy tags in design code

Scrollable DataGrid

Composite Controls Problem –How to build more complex UI interaction –Render is possible, but… A Composite Control is –A control containing other controls –Act together to solve a common problem A Composite control must –Implement INamingContainer –Overrides CreateChildControls()

Composite Control RequiredText

Dynamic Template Loading Problem –Choose template based on conditions –Static definition is easy Templates can be dynamically loaded –Page.LoadTemplate(string template) –Template is an *.ascx file Databinding –Must explicitly set Container data type –Templates must all be in separate files

Dynamic Template Loading

Debugging Controls Problem –How to debug server controls –Cannot just ‘run’ project Steps 1.Build control project in debug mode 2.Set breakpoint(s) 3.In Visual Studio.NET: Debug | Process

Debugging Controls

A look into the future VS.Net 2005 will provide more than 70 new Server Controls Partners will (and already do) provide lots of controls that can be used in the same way as the standard controls PAG group is now providing details on how to do complex tasks well via their “Blue Bricks”

Conclusion Server Controls can be very useful Not a technology without its complexities Read MS Press book by Nikhil Kothari

Server Control Tips & Tricks Patrick J. Hynds CTO, CriticalSites, Boston and New York Microsoft Regional Director for Boston MCSE+I, MCSD, MCDBA, MCT Please fill out your session evaluations!