SlideShare ist ein Scribd-Unternehmen logo
1 von 21
Asp.Net Control Architecture Sundararajan Subramanian Software Development Engineer |  Microsoft Sundararajan.Subramanian@microsoft.com
Agenda Introduction What is a Custom Control? Custom Controls  User Controls Server Controls User Controls – Demo Server Controls – Rendering – Demo Properties & State Management Control Life Cycle. Server Controls – Composite Controls Event Handling Summary
What is a Server Control? .Net component that is used to generate the user interface of an ASP.NET Web application. Eg: Label, GridView, etc.,
Types of Controls Declarative Markup in .Aspx Page  Common functionalities Refactored into a User Control - .ascx  Reusable behavior built /compiled and packaged as Server Control
Ways to Author Custom controls User Controls Simple, declarative authoring model (.ascx file) Scoped to a single application Well suited to static content and layout “Custom” or Compiled Controls Code-based authoring model (.cs or .vb class file) Easily shared across applications Well suited to dynamic or programmatic generation of content and layout More complex, but also more capabilities
User Controls DEMO
Custom Server control – Rendering Sample DEMO
Which Base Class To Choose? System.Web.UI.control System.Web.UI.WebControls.WebControl Derive from Existing Controls
Properties	 Getters And Setters Allows the Client to set the properties at design time or runtime. String  _Text; Public String Text{ get {  return _Text; } Set {  _Text=Value; } }
State Management View State  Session State Application State Control state  Override Savecontrolstate and Loadcontrolstate Custom State management Override LoadViewstate and SaveviewState
State Management - Sample [ Bindable(true), Category("Appearance"), DefaultValue(""), Description(“...") ] public string Text {     get {         object o = ViewState[“Text"];         if (o == null)              return String.Empty;             else             return (string)o;     }     set { ViewState[“Text"] = value;     } }
Control Life Cycle Post Back Only
Control Life Cycle …. Post Back Only
Raising an Event Define the EventArgs Define the Event Delegate Define a method that invokes the event Delegate public class LogOutEventArgs : EventArgs {...} public delegate void LogOutEventHandler(object sender,LogOutEventArgs e); protected virtual void OnLogOut(LogOutEventArgs e) {         if (LogOut != null) { LogOut(this, e);         }     }
Raising Events DEMO
Composite controls Based on object composition Combining the existing controls and delegating the responsibility to the existing controls. Reuses the feature of existing controls
Composite Control Event Handling DEMO
Performance Considerations	 Use Event Properties for handling Events Store only necessary information in State Store very minimal information in Control state
Summary	 Controls provide ways to reuse functionality in web apps Use User controls for within application usage Create Specialized derived controls to make Incremental changes to existing controls Use Composition to leverage existing controls to build more complex controls
Contact Contact me @  http://blogs.msdn.com/sundararajan Sundararajan.subramanian@microsoft.com
Asp.Net Control Architecture

Weitere ähnliche Inhalte

Was ist angesagt?

Dependency Inversion in large-scale TypeScript applications with InversifyJS
Dependency Inversion in large-scale TypeScript applications with InversifyJSDependency Inversion in large-scale TypeScript applications with InversifyJS
Dependency Inversion in large-scale TypeScript applications with InversifyJSRemo Jansen
 
[Codecamp 2016] Going functional with flyd and react
[Codecamp 2016] Going functional with flyd and react [Codecamp 2016] Going functional with flyd and react
[Codecamp 2016] Going functional with flyd and react gcazaciuc
 
Getting Started with NgRx (Redux) Angular
Getting Started with NgRx (Redux) AngularGetting Started with NgRx (Redux) Angular
Getting Started with NgRx (Redux) AngularGustavo Costa
 
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)GreeceJS
 
Cycle.js - A functional reactive UI framework
Cycle.js - A functional reactive UI frameworkCycle.js - A functional reactive UI framework
Cycle.js - A functional reactive UI frameworkNikos Kalogridis
 
Functional UIs with Java 8 and Vaadin JavaOne2014
Functional UIs with Java 8 and Vaadin JavaOne2014Functional UIs with Java 8 and Vaadin JavaOne2014
Functional UIs with Java 8 and Vaadin JavaOne2014hezamu
 
Predictable reactive state management - ngrx
Predictable reactive state management - ngrxPredictable reactive state management - ngrx
Predictable reactive state management - ngrxIlia Idakiev
 
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥Remo Jansen
 
Three Lessons about Gatling and Microservices
Three Lessons about Gatling and MicroservicesThree Lessons about Gatling and Microservices
Three Lessons about Gatling and MicroservicesDragos Manolescu
 
React state management with Redux and MobX
React state management with Redux and MobXReact state management with Redux and MobX
React state management with Redux and MobXDarko Kukovec
 
Functional Reactive Endpoints using Spring 5
Functional Reactive Endpoints using Spring 5Functional Reactive Endpoints using Spring 5
Functional Reactive Endpoints using Spring 5Rory Preddy
 
Vasyl Sydorivskiy - Angular Functional Style
Vasyl Sydorivskiy - Angular Functional StyleVasyl Sydorivskiy - Angular Functional Style
Vasyl Sydorivskiy - Angular Functional StyleInnovecs
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Paco de la Cruz
 
동기화 시대를 뛰어넘는 비동기 프로그래밍
동기화 시대를 뛰어넘는 비동기 프로그래밍동기화 시대를 뛰어넘는 비동기 프로그래밍
동기화 시대를 뛰어넘는 비동기 프로그래밍명신 김
 
ASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsRandy Connolly
 
Spfx with react redux
Spfx with react reduxSpfx with react redux
Spfx with react reduxRajesh Kumar
 
Predictable reactive state management for enterprise apps using NGRX/platform
Predictable reactive state management for enterprise apps using NGRX/platformPredictable reactive state management for enterprise apps using NGRX/platform
Predictable reactive state management for enterprise apps using NGRX/platformIlia Idakiev
 

Was ist angesagt? (20)

Dependency Inversion in large-scale TypeScript applications with InversifyJS
Dependency Inversion in large-scale TypeScript applications with InversifyJSDependency Inversion in large-scale TypeScript applications with InversifyJS
Dependency Inversion in large-scale TypeScript applications with InversifyJS
 
[Codecamp 2016] Going functional with flyd and react
[Codecamp 2016] Going functional with flyd and react [Codecamp 2016] Going functional with flyd and react
[Codecamp 2016] Going functional with flyd and react
 
Web controls
Web controlsWeb controls
Web controls
 
Getting Started with NgRx (Redux) Angular
Getting Started with NgRx (Redux) AngularGetting Started with NgRx (Redux) Angular
Getting Started with NgRx (Redux) Angular
 
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
Cycle.js - Functional reactive UI framework (Nikos Kalogridis)
 
Cycle.js - A functional reactive UI framework
Cycle.js - A functional reactive UI frameworkCycle.js - A functional reactive UI framework
Cycle.js - A functional reactive UI framework
 
Controller
ControllerController
Controller
 
Functional UIs with Java 8 and Vaadin JavaOne2014
Functional UIs with Java 8 and Vaadin JavaOne2014Functional UIs with Java 8 and Vaadin JavaOne2014
Functional UIs with Java 8 and Vaadin JavaOne2014
 
Predictable reactive state management - ngrx
Predictable reactive state management - ngrxPredictable reactive state management - ngrx
Predictable reactive state management - ngrx
 
Using redux
Using reduxUsing redux
Using redux
 
React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥React + Redux + TypeScript === ♥
React + Redux + TypeScript === ♥
 
Three Lessons about Gatling and Microservices
Three Lessons about Gatling and MicroservicesThree Lessons about Gatling and Microservices
Three Lessons about Gatling and Microservices
 
React state management with Redux and MobX
React state management with Redux and MobXReact state management with Redux and MobX
React state management with Redux and MobX
 
Functional Reactive Endpoints using Spring 5
Functional Reactive Endpoints using Spring 5Functional Reactive Endpoints using Spring 5
Functional Reactive Endpoints using Spring 5
 
Vasyl Sydorivskiy - Angular Functional Style
Vasyl Sydorivskiy - Angular Functional StyleVasyl Sydorivskiy - Angular Functional Style
Vasyl Sydorivskiy - Angular Functional Style
 
Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)Azure Durable Functions (2019-04-27)
Azure Durable Functions (2019-04-27)
 
동기화 시대를 뛰어넘는 비동기 프로그래밍
동기화 시대를 뛰어넘는 비동기 프로그래밍동기화 시대를 뛰어넘는 비동기 프로그래밍
동기화 시대를 뛰어넘는 비동기 프로그래밍
 
ASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server ControlsASP.NET 03 - Working With Web Server Controls
ASP.NET 03 - Working With Web Server Controls
 
Spfx with react redux
Spfx with react reduxSpfx with react redux
Spfx with react redux
 
Predictable reactive state management for enterprise apps using NGRX/platform
Predictable reactive state management for enterprise apps using NGRX/platformPredictable reactive state management for enterprise apps using NGRX/platform
Predictable reactive state management for enterprise apps using NGRX/platform
 

Andere mochten auch

State management in ASP.NET
State management in ASP.NETState management in ASP.NET
State management in ASP.NETOm Vikram Thapa
 
ASP.NET State management
ASP.NET State managementASP.NET State management
ASP.NET State managementShivanand Arur
 
Ajax control asp.net
Ajax control asp.netAjax control asp.net
Ajax control asp.netSireesh K
 
Validation controls ppt
Validation controls pptValidation controls ppt
Validation controls pptIblesoft
 
Presentation on asp.net controls
Presentation on asp.net controlsPresentation on asp.net controls
Presentation on asp.net controlsReshi Unen
 
Seminar ppt on digital signature
Seminar ppt on digital signatureSeminar ppt on digital signature
Seminar ppt on digital signaturejolly9293
 
Validation controls in asp
Validation controls in aspValidation controls in asp
Validation controls in aspShishir Jain
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NETPeter Gfader
 
Electronic data interchange
Electronic data interchangeElectronic data interchange
Electronic data interchangeAbhishek Nayak
 
State management
State managementState management
State managementIblesoft
 
How to make more impact as an engineer
How to make more impact as an engineerHow to make more impact as an engineer
How to make more impact as an engineerPeter Gfader
 
State Management in ASP.NET
State Management in ASP.NETState Management in ASP.NET
State Management in ASP.NETShyam Sir
 
Electronic data interchange
Electronic data interchangeElectronic data interchange
Electronic data interchangeRohit Kumar
 
Introduction To Asp.Net Ajax
Introduction To Asp.Net AjaxIntroduction To Asp.Net Ajax
Introduction To Asp.Net AjaxJeff Blankenburg
 
Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web FormsSAMIR BHOGAYTA
 
Presentation - Electronic Data Interchange
Presentation - Electronic Data InterchangePresentation - Electronic Data Interchange
Presentation - Electronic Data InterchangeSharad Srivastava
 

Andere mochten auch (20)

State management in ASP.NET
State management in ASP.NETState management in ASP.NET
State management in ASP.NET
 
ASP.NET State management
ASP.NET State managementASP.NET State management
ASP.NET State management
 
Ajax control asp.net
Ajax control asp.netAjax control asp.net
Ajax control asp.net
 
Validation controls ppt
Validation controls pptValidation controls ppt
Validation controls ppt
 
Presentation on asp.net controls
Presentation on asp.net controlsPresentation on asp.net controls
Presentation on asp.net controls
 
Seminar ppt on digital signature
Seminar ppt on digital signatureSeminar ppt on digital signature
Seminar ppt on digital signature
 
Validation controls in asp
Validation controls in aspValidation controls in asp
Validation controls in asp
 
Introduction to ASP.NET
Introduction to ASP.NETIntroduction to ASP.NET
Introduction to ASP.NET
 
Ch3 server controls
Ch3 server controlsCh3 server controls
Ch3 server controls
 
Electronic data interchange
Electronic data interchangeElectronic data interchange
Electronic data interchange
 
State management
State managementState management
State management
 
How to make more impact as an engineer
How to make more impact as an engineerHow to make more impact as an engineer
How to make more impact as an engineer
 
State Management in ASP.NET
State Management in ASP.NETState Management in ASP.NET
State Management in ASP.NET
 
Electronic data interchange
Electronic data interchangeElectronic data interchange
Electronic data interchange
 
Controls in asp.net
Controls in asp.netControls in asp.net
Controls in asp.net
 
Asp.net.
Asp.net.Asp.net.
Asp.net.
 
Introduction To Asp.Net Ajax
Introduction To Asp.Net AjaxIntroduction To Asp.Net Ajax
Introduction To Asp.Net Ajax
 
Intro To Asp Net And Web Forms
Intro To Asp Net And Web FormsIntro To Asp Net And Web Forms
Intro To Asp Net And Web Forms
 
Presentation - Electronic Data Interchange
Presentation - Electronic Data InterchangePresentation - Electronic Data Interchange
Presentation - Electronic Data Interchange
 
Standard control in asp.net
Standard control in asp.netStandard control in asp.net
Standard control in asp.net
 

Ähnlich wie Asp.Net Control Architecture

Controllers & actions
Controllers & actionsControllers & actions
Controllers & actionsEyal Vardi
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentChui-Wen Chiu
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular jsAayush Shrestha
 
ASP.NET AJAX Basics
ASP.NET AJAX BasicsASP.NET AJAX Basics
ASP.NET AJAX Basicspetrov
 
Content-Driven Apps with React
Content-Driven Apps with ReactContent-Driven Apps with React
Content-Driven Apps with ReactNetcetera
 
Net framework session03
Net framework session03Net framework session03
Net framework session03Vivek chan
 
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBuilding workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBizTalk360
 
ENT401 Deep Dive with Amazon EC2 Systems Manager
ENT401 Deep Dive with Amazon EC2 Systems ManagerENT401 Deep Dive with Amazon EC2 Systems Manager
ENT401 Deep Dive with Amazon EC2 Systems ManagerAmazon Web Services
 
Amazon EC2 Systems Manager for Hybrid Cloud Management at Scale
Amazon EC2 Systems Manager for Hybrid Cloud Management at ScaleAmazon EC2 Systems Manager for Hybrid Cloud Management at Scale
Amazon EC2 Systems Manager for Hybrid Cloud Management at ScaleAmazon Web Services
 
Intoduction to Play Framework
Intoduction to Play FrameworkIntoduction to Play Framework
Intoduction to Play FrameworkKnoldus Inc.
 
Introduction to the INTEGRAL FRAMEWORK
Introduction to the INTEGRAL FRAMEWORKIntroduction to the INTEGRAL FRAMEWORK
Introduction to the INTEGRAL FRAMEWORKKarthik Subramanian
 
Introduction to the integral framework
Introduction to the integral frameworkIntroduction to the integral framework
Introduction to the integral frameworkKarthik Subramanian
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCBarry Gervin
 
Booa8 Slide 09
Booa8 Slide 09Booa8 Slide 09
Booa8 Slide 09oswchavez
 

Ähnlich wie Asp.Net Control Architecture (20)

Controllers & actions
Controllers & actionsControllers & actions
Controllers & actions
 
Asp.Net Ajax Component Development
Asp.Net Ajax Component DevelopmentAsp.Net Ajax Component Development
Asp.Net Ajax Component Development
 
Understanding angular js
Understanding angular jsUnderstanding angular js
Understanding angular js
 
Asp.net mvc
Asp.net mvcAsp.net mvc
Asp.net mvc
 
ASP.NET AJAX Basics
ASP.NET AJAX BasicsASP.NET AJAX Basics
ASP.NET AJAX Basics
 
QTP Online Training
QTP Online TrainingQTP Online Training
QTP Online Training
 
Content-Driven Apps with React
Content-Driven Apps with ReactContent-Driven Apps with React
Content-Driven Apps with React
 
Wwf
WwfWwf
Wwf
 
Net framework session03
Net framework session03Net framework session03
Net framework session03
 
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration MondayBuilding workflow solution with Microsoft Azure and Cloud | Integration Monday
Building workflow solution with Microsoft Azure and Cloud | Integration Monday
 
ENT401 Deep Dive with Amazon EC2 Systems Manager
ENT401 Deep Dive with Amazon EC2 Systems ManagerENT401 Deep Dive with Amazon EC2 Systems Manager
ENT401 Deep Dive with Amazon EC2 Systems Manager
 
Amazon EC2 Systems Manager for Hybrid Cloud Management at Scale
Amazon EC2 Systems Manager for Hybrid Cloud Management at ScaleAmazon EC2 Systems Manager for Hybrid Cloud Management at Scale
Amazon EC2 Systems Manager for Hybrid Cloud Management at Scale
 
About Qtp 92
About Qtp 92About Qtp 92
About Qtp 92
 
About QTP 9.2
About QTP 9.2About QTP 9.2
About QTP 9.2
 
About Qtp_1 92
About Qtp_1 92About Qtp_1 92
About Qtp_1 92
 
Intoduction to Play Framework
Intoduction to Play FrameworkIntoduction to Play Framework
Intoduction to Play Framework
 
Introduction to the INTEGRAL FRAMEWORK
Introduction to the INTEGRAL FRAMEWORKIntroduction to the INTEGRAL FRAMEWORK
Introduction to the INTEGRAL FRAMEWORK
 
Introduction to the integral framework
Introduction to the integral frameworkIntroduction to the integral framework
Introduction to the integral framework
 
CTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVCCTTDNUG ASP.NET MVC
CTTDNUG ASP.NET MVC
 
Booa8 Slide 09
Booa8 Slide 09Booa8 Slide 09
Booa8 Slide 09
 

Kürzlich hochgeladen

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 

Kürzlich hochgeladen (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 

Asp.Net Control Architecture

  • 1. Asp.Net Control Architecture Sundararajan Subramanian Software Development Engineer | Microsoft Sundararajan.Subramanian@microsoft.com
  • 2. Agenda Introduction What is a Custom Control? Custom Controls User Controls Server Controls User Controls – Demo Server Controls – Rendering – Demo Properties & State Management Control Life Cycle. Server Controls – Composite Controls Event Handling Summary
  • 3. What is a Server Control? .Net component that is used to generate the user interface of an ASP.NET Web application. Eg: Label, GridView, etc.,
  • 4. Types of Controls Declarative Markup in .Aspx Page Common functionalities Refactored into a User Control - .ascx Reusable behavior built /compiled and packaged as Server Control
  • 5. Ways to Author Custom controls User Controls Simple, declarative authoring model (.ascx file) Scoped to a single application Well suited to static content and layout “Custom” or Compiled Controls Code-based authoring model (.cs or .vb class file) Easily shared across applications Well suited to dynamic or programmatic generation of content and layout More complex, but also more capabilities
  • 7. Custom Server control – Rendering Sample DEMO
  • 8. Which Base Class To Choose? System.Web.UI.control System.Web.UI.WebControls.WebControl Derive from Existing Controls
  • 9. Properties Getters And Setters Allows the Client to set the properties at design time or runtime. String _Text; Public String Text{ get { return _Text; } Set { _Text=Value; } }
  • 10. State Management View State Session State Application State Control state Override Savecontrolstate and Loadcontrolstate Custom State management Override LoadViewstate and SaveviewState
  • 11. State Management - Sample [ Bindable(true), Category("Appearance"), DefaultValue(""), Description(“...") ] public string Text { get { object o = ViewState[“Text"]; if (o == null) return String.Empty; else return (string)o; } set { ViewState[“Text"] = value; } }
  • 12. Control Life Cycle Post Back Only
  • 13. Control Life Cycle …. Post Back Only
  • 14. Raising an Event Define the EventArgs Define the Event Delegate Define a method that invokes the event Delegate public class LogOutEventArgs : EventArgs {...} public delegate void LogOutEventHandler(object sender,LogOutEventArgs e); protected virtual void OnLogOut(LogOutEventArgs e) { if (LogOut != null) { LogOut(this, e); } }
  • 16. Composite controls Based on object composition Combining the existing controls and delegating the responsibility to the existing controls. Reuses the feature of existing controls
  • 17. Composite Control Event Handling DEMO
  • 18. Performance Considerations Use Event Properties for handling Events Store only necessary information in State Store very minimal information in Control state
  • 19. Summary Controls provide ways to reuse functionality in web apps Use User controls for within application usage Create Specialized derived controls to make Incremental changes to existing controls Use Composition to leverage existing controls to build more complex controls
  • 20. Contact Contact me @ http://blogs.msdn.com/sundararajan Sundararajan.subramanian@microsoft.com