SlideShare uma empresa Scribd logo
1 de 37
Controls im Web
ASP.NET Controls für Web Forms und MVC
Daniel Fisher (lennybacon) | devcoach.com
Lennybacon.com
■ Daniel Fisher | CTO & Software Architect
■
MCP, MCTS, MCPD…
daniel.fisher@devcoach.com
■ Mit-Gründer und Geschäftsführer von devcoach.com
www.devcoach.com
■ Mit-Gründer und Vorstand der
gemeinnützigen www.just community.de e.V.
■ Veranstalter des größten Entwickler & IT-Pro
Community Events in Deutschland: www.nrwconf.de
■ Mit-Gründer und Leiter der
INETA Usergroup Düsseldorf
www.NetUG-NiederRhein.de
■ Mitglied im Microsoft
Community Leader & Insider Program (CLIP)
■ Connected Systems Advisory Board
Expertengruppe für WCF, WF & BizTalk
Efficient Communication…
devcoach.com
■ Leistungen
■ Architektur-Beratung
Strukturierter und effizienter zu einer wartbaren Anwendung.
■ Software-Entwicklung
Team-out-of-the-box (Near-shoring)
Objektmodelle und Datenzugriff
Kommunikations-Infrastrukturen
Identitäts- und Berechtigungsmodelle
Web 2.0 und Rich Internet Applikation
■ Coaching & Training
Technologien schneller verstehen und richtig einsetzen.
■ Technologien
■ Microsoft Windows & .NET Framework
ASP.NET, WCF, WF, WPF, Silverlight & Geneva
■ Kunden
■ Versicherung, Finanzindustrie, Mittelstand, Handel, Kommunikation,
Softwarehersteller u.v.a.
Bundesamt für Sicherheit in der Informationstechnologie,
Microsoft, Dresdner Bank…
Project
Experience
Technology
Know-how
devcoach®
Agenda
• Web Controls
• What‘s MVC anyway?
• Recap 2006
• Controls for the Microsoft Web Platform
• Summary
7
Is all about Maintainablility!
■ The controls concept achieves reusability for
■ Html mark-up
■ Server-side code
■ Client-side scripts
■ Compiled code that can be reused in any
ASP.NET web application.
Controls in Code
public class MyControl
: Control
{
//…
}
Controls in Code: Usage
<asp:Contol
id="MyId"
runat="server"
/>
Web Form Pros
Web Form Cons
■ No visual way of developing server controls,
generated via code.
What‘s MVC anyway?
Concepts
• Nice URLs & Routing
• Process over „just add a Form“
• Loads of naming conventions
• Code, Code, Code
• As strongly typed as possible!
• Once build, forever used…
Concepts cont.
• No Code-Behind for ASPXs
• No Postbacks
• No Viewstate
• And last but not least „No controls out of Redmond“!
Web Forms or MVC?
Once apon a time…
18
Processing
■ Child control creation
■ CreateChildControls()
■ All display logic
■ OnPreRender()
■ Rendering
■ Custom: Render()
■ Composite: Nothing to do?
PROBLEM #1: POSTBACKS
First Aid
■ Response.Redirect(
http://example.org);
■ Server.Transfer(
http://example.org);
■ <a href=“…“>link</a>
■ Server side only events
■ AJAX
PROBLEM #2: VIEWSTATE
23
Postback - Lifecycle of a control
Instantiate : Constructor
Initialize : OnInit method and Init Event
Begin Tracking View State : TrackViewState
Load View State : LoadViewState method
Load Postback Data : IPostBackDataHandler.LoadPostdata method
Load: OnLoad method and Load event
Raise Changed Events : IPostBackDataHandler.RaisePostDataChangedEvent method
Raise Postback Event : IPostBackEventHandler.RaisePostBackEvent method
PreRender : OnPreRender method and PreRender event
Save View State : SaveViewState method
Render : Render method
Unload : OnUnload method and Unload event
Dispose : Dispose Method
24
ViewState
■ ViewState is used to track and restore the state
values of controls that would otherwise be lost
■ Base64 encoded - not easily readable, but not
encrypted!
■ What to store
■ Integers
■ Strings
■ Floats
■ Decimals
■ Arrays of the data types stated above
Viewstate in code
[Bindable(false)]
[Category("Appearance")]
[DefaultValue("This is the default text.")]
[Description("The text of the custom control.")]
public virtual string Text
{
get
{
var o = ViewState["Text"];
return o!=null
? (string) o
: "This is the default text.";
}
set { ViewState["Text"] = value; }
}
Viewstate in markup
First Aid
■ Query Request.Form and
Request.QueryString
■ Use local fields
■ most times they work fine!
PROBLEM #3: BINDING
Binding in code
public overrride OnInit(
object sender, EventArgs e)
{
List<Person> persons =
Repository<Person>.GetAll();
myControl.DataSource = persons;
myControl.DataBind()
}
First Aid
■ HttpContext.Current.Items
■ Cast to ViewPage
■ Access Model
■ Cast to IEnumerable
PROBLEM #4: RESOURCES
Resources
■ Images
■ Java Script
■ Styles
Resources in code
[assembly: WebResource(
"devcoach.Web.UI.Controls.Busy.gif",
"image/gif")]
imageUrl =
Page.ClientScript.GetWebResourceUrl(
GetType(),
"devcoach.Web.UI.Controls.Busy.gif");
First Aid
■ Embedded
■ VirtualPathProvider
■ Routing
2010 - Basta: ASP.NET Controls für Web Forms und MVC

Mais conteúdo relacionado

Destaque

2005 - NRW Conf: Design, Entwicklung und Tests
2005 - NRW Conf: Design, Entwicklung und Tests2005 - NRW Conf: Design, Entwicklung und Tests
2005 - NRW Conf: Design, Entwicklung und TestsDaniel Fisher
 
2006 - Basta!: Advanced server controls
2006 - Basta!: Advanced server controls2006 - Basta!: Advanced server controls
2006 - Basta!: Advanced server controlsDaniel Fisher
 
2008 - Basta!: DAL DIY
2008 - Basta!: DAL DIY2008 - Basta!: DAL DIY
2008 - Basta!: DAL DIYDaniel Fisher
 
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...Daniel Fisher
 
2010 - Basta!: REST mit ASP.NET MVC
2010 - Basta!: REST mit ASP.NET MVC2010 - Basta!: REST mit ASP.NET MVC
2010 - Basta!: REST mit ASP.NET MVCDaniel Fisher
 
2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with VoltaDaniel Fisher
 
2011 - DNC: REST Wars
2011 - DNC: REST Wars2011 - DNC: REST Wars
2011 - DNC: REST WarsDaniel Fisher
 
2011 - Dotnet Information Day: NUGET
2011 - Dotnet Information Day: NUGET2011 - Dotnet Information Day: NUGET
2011 - Dotnet Information Day: NUGETDaniel Fisher
 
2009 - DNC: Silverlight ohne UI - Nur als Cache
2009 - DNC: Silverlight ohne UI - Nur als Cache2009 - DNC: Silverlight ohne UI - Nur als Cache
2009 - DNC: Silverlight ohne UI - Nur als CacheDaniel Fisher
 
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrowDaniel Fisher
 
Unit 7 lesson d
Unit 7  lesson dUnit 7  lesson d
Unit 7 lesson dmyquintero
 
Unit 7 lesson d
Unit 7  lesson dUnit 7  lesson d
Unit 7 lesson dmyquintero
 
2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...
2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...
2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...Daniel Fisher
 
Saturation vs satisfaction in it industry
Saturation vs satisfaction in it industrySaturation vs satisfaction in it industry
Saturation vs satisfaction in it industryChirabrata Majumder
 
2008 - Afterlaunch: 10 Tipps für WCF
2008 - Afterlaunch: 10 Tipps für WCF2008 - Afterlaunch: 10 Tipps für WCF
2008 - Afterlaunch: 10 Tipps für WCFDaniel Fisher
 
2006 - Basta!: Web 2.0 mit asp.net 2.0
2006 - Basta!: Web 2.0 mit asp.net 2.02006 - Basta!: Web 2.0 mit asp.net 2.0
2006 - Basta!: Web 2.0 mit asp.net 2.0Daniel Fisher
 
Hult prize Social Entrepreneurship Competion
Hult prize Social Entrepreneurship CompetionHult prize Social Entrepreneurship Competion
Hult prize Social Entrepreneurship CompetionAbhishek Mandloi
 

Destaque (20)

2005 - NRW Conf: Design, Entwicklung und Tests
2005 - NRW Conf: Design, Entwicklung und Tests2005 - NRW Conf: Design, Entwicklung und Tests
2005 - NRW Conf: Design, Entwicklung und Tests
 
2006 - Basta!: Advanced server controls
2006 - Basta!: Advanced server controls2006 - Basta!: Advanced server controls
2006 - Basta!: Advanced server controls
 
2008 - Basta!: DAL DIY
2008 - Basta!: DAL DIY2008 - Basta!: DAL DIY
2008 - Basta!: DAL DIY
 
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
2015 TechSummit Web & Cloud - Gem, NPM, Bower, Nuget, Paket - Päckchen hier, ...
 
2010 - Basta!: REST mit ASP.NET MVC
2010 - Basta!: REST mit ASP.NET MVC2010 - Basta!: REST mit ASP.NET MVC
2010 - Basta!: REST mit ASP.NET MVC
 
2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta
 
2011 - DNC: REST Wars
2011 - DNC: REST Wars2011 - DNC: REST Wars
2011 - DNC: REST Wars
 
2011 - Dotnet Information Day: NUGET
2011 - Dotnet Information Day: NUGET2011 - Dotnet Information Day: NUGET
2011 - Dotnet Information Day: NUGET
 
2009 - DNC: Silverlight ohne UI - Nur als Cache
2009 - DNC: Silverlight ohne UI - Nur als Cache2009 - DNC: Silverlight ohne UI - Nur als Cache
2009 - DNC: Silverlight ohne UI - Nur als Cache
 
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
2008 - TechDays PT: Modeling and Composition for Software today and tomorrow
 
personal visual resume
personal visual resumepersonal visual resume
personal visual resume
 
My Cool Visual Resume
My Cool Visual ResumeMy Cool Visual Resume
My Cool Visual Resume
 
Unit 7 lesson d
Unit 7  lesson dUnit 7  lesson d
Unit 7 lesson d
 
Unit 7 lesson d
Unit 7  lesson dUnit 7  lesson d
Unit 7 lesson d
 
2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...
2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...
2015 - Network 2015, UA: Defensive programming, resilience patterns & antifra...
 
Saturation vs satisfaction in it industry
Saturation vs satisfaction in it industrySaturation vs satisfaction in it industry
Saturation vs satisfaction in it industry
 
Pļavu bibliotēka
Pļavu bibliotēkaPļavu bibliotēka
Pļavu bibliotēka
 
2008 - Afterlaunch: 10 Tipps für WCF
2008 - Afterlaunch: 10 Tipps für WCF2008 - Afterlaunch: 10 Tipps für WCF
2008 - Afterlaunch: 10 Tipps für WCF
 
2006 - Basta!: Web 2.0 mit asp.net 2.0
2006 - Basta!: Web 2.0 mit asp.net 2.02006 - Basta!: Web 2.0 mit asp.net 2.0
2006 - Basta!: Web 2.0 mit asp.net 2.0
 
Hult prize Social Entrepreneurship Competion
Hult prize Social Entrepreneurship CompetionHult prize Social Entrepreneurship Competion
Hult prize Social Entrepreneurship Competion
 

Semelhante a 2010 - Basta: ASP.NET Controls für Web Forms und MVC

Tibco business events ( be ) online & corporate training by virtualnuggets
Tibco business events ( be ) online & corporate training by virtualnuggetsTibco business events ( be ) online & corporate training by virtualnuggets
Tibco business events ( be ) online & corporate training by virtualnuggetspsrani
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Doris Chen
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsChris Love
 
Kentico 8 EMS API Deep Dive
Kentico 8 EMS API Deep DiveKentico 8 EMS API Deep Dive
Kentico 8 EMS API Deep DiveBrian McKeiver
 
Rutgers - FrontPage 98 (Advanced)
Rutgers - FrontPage 98 (Advanced)Rutgers - FrontPage 98 (Advanced)
Rutgers - FrontPage 98 (Advanced)Michael Dobe, Ph.D.
 
Software Analysis for the Web: Achievements and Prospects
Software Analysis for the Web: Achievements and ProspectsSoftware Analysis for the Web: Achievements and Prospects
Software Analysis for the Web: Achievements and ProspectsAli Mesbah
 
MVC Design Pattern in JavaScript by ADMEC Multimedia Institute
MVC Design Pattern in JavaScript by ADMEC Multimedia InstituteMVC Design Pattern in JavaScript by ADMEC Multimedia Institute
MVC Design Pattern in JavaScript by ADMEC Multimedia InstituteRavi Bhadauria
 
Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5Devang Garach
 
LeanIX Architecture Gathering 2018
LeanIX Architecture Gathering 2018LeanIX Architecture Gathering 2018
LeanIX Architecture Gathering 2018LeanIX GmbH
 
Daniel Egan Msdn Tech Days Oc
Daniel Egan Msdn Tech Days OcDaniel Egan Msdn Tech Days Oc
Daniel Egan Msdn Tech Days OcDaniel Egan
 
Serverless Single Page Apps with React and Redux at ItCamp 2017
Serverless Single Page Apps with React and Redux at ItCamp 2017Serverless Single Page Apps with React and Redux at ItCamp 2017
Serverless Single Page Apps with React and Redux at ItCamp 2017Melania Andrisan (Danciu)
 
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and ScaleGDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and ScalePatrick Chanezon
 
MA Microservices Meetup: Move fast and make things
MA Microservices Meetup: Move fast and make thingsMA Microservices Meetup: Move fast and make things
MA Microservices Meetup: Move fast and make thingsAmbassador Labs
 
Modern ASP.NET Webskills
Modern ASP.NET WebskillsModern ASP.NET Webskills
Modern ASP.NET WebskillsCaleb Jenkins
 
"Offline mode for a mobile application, redux on server and a little bit abou...
"Offline mode for a mobile application, redux on server and a little bit abou..."Offline mode for a mobile application, redux on server and a little bit abou...
"Offline mode for a mobile application, redux on server and a little bit abou...Viktor Turskyi
 
WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012Dmitri Artamonov
 
MeasureWorks - Why your customers don't like to wait!
MeasureWorks - Why your customers don't like to wait!MeasureWorks - Why your customers don't like to wait!
MeasureWorks - Why your customers don't like to wait!MeasureWorks
 

Semelhante a 2010 - Basta: ASP.NET Controls für Web Forms und MVC (20)

Beyond The MVC
Beyond The MVCBeyond The MVC
Beyond The MVC
 
Design Based Dev
Design Based DevDesign Based Dev
Design Based Dev
 
Tibco business events ( be ) online & corporate training by virtualnuggets
Tibco business events ( be ) online & corporate training by virtualnuggetsTibco business events ( be ) online & corporate training by virtualnuggets
Tibco business events ( be ) online & corporate training by virtualnuggets
 
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
Building Beautiful and Interactive Metro apps with JavaScript, HTML5 & CSS3
 
Disrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applicationsDisrupting the application eco system with progressive web applications
Disrupting the application eco system with progressive web applications
 
Kentico 8 EMS API Deep Dive
Kentico 8 EMS API Deep DiveKentico 8 EMS API Deep Dive
Kentico 8 EMS API Deep Dive
 
Rutgers - FrontPage 98 (Advanced)
Rutgers - FrontPage 98 (Advanced)Rutgers - FrontPage 98 (Advanced)
Rutgers - FrontPage 98 (Advanced)
 
Software Analysis for the Web: Achievements and Prospects
Software Analysis for the Web: Achievements and ProspectsSoftware Analysis for the Web: Achievements and Prospects
Software Analysis for the Web: Achievements and Prospects
 
MVC Design Pattern in JavaScript by ADMEC Multimedia Institute
MVC Design Pattern in JavaScript by ADMEC Multimedia InstituteMVC Design Pattern in JavaScript by ADMEC Multimedia Institute
MVC Design Pattern in JavaScript by ADMEC Multimedia Institute
 
Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5Overview of React.JS - Internship Presentation - Week 5
Overview of React.JS - Internship Presentation - Week 5
 
ASP.NET-MVC-Part-1.ppt
ASP.NET-MVC-Part-1.pptASP.NET-MVC-Part-1.ppt
ASP.NET-MVC-Part-1.ppt
 
LeanIX Architecture Gathering 2018
LeanIX Architecture Gathering 2018LeanIX Architecture Gathering 2018
LeanIX Architecture Gathering 2018
 
Daniel Egan Msdn Tech Days Oc
Daniel Egan Msdn Tech Days OcDaniel Egan Msdn Tech Days Oc
Daniel Egan Msdn Tech Days Oc
 
Serverless Single Page Apps with React and Redux at ItCamp 2017
Serverless Single Page Apps with React and Redux at ItCamp 2017Serverless Single Page Apps with React and Redux at ItCamp 2017
Serverless Single Page Apps with React and Redux at ItCamp 2017
 
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and ScaleGDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
GDD Japan 2009 - Designing OpenSocial Apps For Speed and Scale
 
MA Microservices Meetup: Move fast and make things
MA Microservices Meetup: Move fast and make thingsMA Microservices Meetup: Move fast and make things
MA Microservices Meetup: Move fast and make things
 
Modern ASP.NET Webskills
Modern ASP.NET WebskillsModern ASP.NET Webskills
Modern ASP.NET Webskills
 
"Offline mode for a mobile application, redux on server and a little bit abou...
"Offline mode for a mobile application, redux on server and a little bit abou..."Offline mode for a mobile application, redux on server and a little bit abou...
"Offline mode for a mobile application, redux on server and a little bit abou...
 
WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012WinJS at NYC Code Camp 2012
WinJS at NYC Code Camp 2012
 
MeasureWorks - Why your customers don't like to wait!
MeasureWorks - Why your customers don't like to wait!MeasureWorks - Why your customers don't like to wait!
MeasureWorks - Why your customers don't like to wait!
 

Mais de Daniel Fisher

MD DevdDays 2016: Defensive programming, resilience patterns & antifragility
MD DevdDays 2016: Defensive programming, resilience patterns & antifragilityMD DevdDays 2016: Defensive programming, resilience patterns & antifragility
MD DevdDays 2016: Defensive programming, resilience patterns & antifragilityDaniel Fisher
 
NRWConf, DE: Defensive programming, resilience patterns & antifragility
NRWConf, DE: Defensive programming, resilience patterns & antifragilityNRWConf, DE: Defensive programming, resilience patterns & antifragility
NRWConf, DE: Defensive programming, resilience patterns & antifragilityDaniel Fisher
 
.NET Developer Days 2015, PL: Defensive programming, resilience patterns & an...
.NET Developer Days 2015, PL: Defensive programming, resilience patterns & an....NET Developer Days 2015, PL: Defensive programming, resilience patterns & an...
.NET Developer Days 2015, PL: Defensive programming, resilience patterns & an...Daniel Fisher
 
2015 - Basta! 2015, DE: JavaScript und build
2015 - Basta! 2015, DE: JavaScript und build2015 - Basta! 2015, DE: JavaScript und build
2015 - Basta! 2015, DE: JavaScript und buildDaniel Fisher
 
2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...
2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...
2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...Daniel Fisher
 
2011 - DotNetFranken: ASP.NET MVC Localization
2011 - DotNetFranken: ASP.NET MVC Localization2011 - DotNetFranken: ASP.NET MVC Localization
2011 - DotNetFranken: ASP.NET MVC LocalizationDaniel Fisher
 
2011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 52011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 5Daniel Fisher
 
2010 - Basta!: REST mit WCF 4, Silverlight und AJAX
2010 - Basta!: REST mit WCF 4, Silverlight und AJAX2010 - Basta!: REST mit WCF 4, Silverlight und AJAX
2010 - Basta!: REST mit WCF 4, Silverlight und AJAXDaniel Fisher
 
2010 - Basta!: IPhone Apps mit C#
2010 - Basta!: IPhone Apps mit C#2010 - Basta!: IPhone Apps mit C#
2010 - Basta!: IPhone Apps mit C#Daniel Fisher
 
2010 Basta!: Massendaten mit ADO.NET
2010 Basta!: Massendaten mit ADO.NET2010 Basta!: Massendaten mit ADO.NET
2010 Basta!: Massendaten mit ADO.NETDaniel Fisher
 
2009 - Microsoft Springbreak: IIS, PHP & WCF
2009 - Microsoft Springbreak: IIS, PHP & WCF2009 - Microsoft Springbreak: IIS, PHP & WCF
2009 - Microsoft Springbreak: IIS, PHP & WCFDaniel Fisher
 
2009 - NRW Conf: (ASP).NET Membership
2009 - NRW Conf: (ASP).NET Membership2009 - NRW Conf: (ASP).NET Membership
2009 - NRW Conf: (ASP).NET MembershipDaniel Fisher
 
2009 Dotnet Information Day: More effective c#
2009 Dotnet Information Day: More effective c#2009 Dotnet Information Day: More effective c#
2009 Dotnet Information Day: More effective c#Daniel Fisher
 
2009 - Basta!: Agiles requirements engineering
2009 - Basta!: Agiles requirements engineering2009 - Basta!: Agiles requirements engineering
2009 - Basta!: Agiles requirements engineeringDaniel Fisher
 
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageabilityDaniel Fisher
 
2008 - Basta!: Massendaten auf dem Client
2008 - Basta!: Massendaten auf dem Client2008 - Basta!: Massendaten auf dem Client
2008 - Basta!: Massendaten auf dem ClientDaniel Fisher
 
2006 DDD4: Data access layers - Convenience vs. Control and Performance?
2006 DDD4: Data access layers - Convenience vs. Control and Performance?2006 DDD4: Data access layers - Convenience vs. Control and Performance?
2006 DDD4: Data access layers - Convenience vs. Control and Performance?Daniel Fisher
 

Mais de Daniel Fisher (17)

MD DevdDays 2016: Defensive programming, resilience patterns & antifragility
MD DevdDays 2016: Defensive programming, resilience patterns & antifragilityMD DevdDays 2016: Defensive programming, resilience patterns & antifragility
MD DevdDays 2016: Defensive programming, resilience patterns & antifragility
 
NRWConf, DE: Defensive programming, resilience patterns & antifragility
NRWConf, DE: Defensive programming, resilience patterns & antifragilityNRWConf, DE: Defensive programming, resilience patterns & antifragility
NRWConf, DE: Defensive programming, resilience patterns & antifragility
 
.NET Developer Days 2015, PL: Defensive programming, resilience patterns & an...
.NET Developer Days 2015, PL: Defensive programming, resilience patterns & an....NET Developer Days 2015, PL: Defensive programming, resilience patterns & an...
.NET Developer Days 2015, PL: Defensive programming, resilience patterns & an...
 
2015 - Basta! 2015, DE: JavaScript und build
2015 - Basta! 2015, DE: JavaScript und build2015 - Basta! 2015, DE: JavaScript und build
2015 - Basta! 2015, DE: JavaScript und build
 
2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...
2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...
2015 - Basta! 2015, DE: Defensive programming, resilience patterns & antifrag...
 
2011 - DotNetFranken: ASP.NET MVC Localization
2011 - DotNetFranken: ASP.NET MVC Localization2011 - DotNetFranken: ASP.NET MVC Localization
2011 - DotNetFranken: ASP.NET MVC Localization
 
2011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 52011 NetUG HH: ASP.NET MVC & HTML 5
2011 NetUG HH: ASP.NET MVC & HTML 5
 
2010 - Basta!: REST mit WCF 4, Silverlight und AJAX
2010 - Basta!: REST mit WCF 4, Silverlight und AJAX2010 - Basta!: REST mit WCF 4, Silverlight und AJAX
2010 - Basta!: REST mit WCF 4, Silverlight und AJAX
 
2010 - Basta!: IPhone Apps mit C#
2010 - Basta!: IPhone Apps mit C#2010 - Basta!: IPhone Apps mit C#
2010 - Basta!: IPhone Apps mit C#
 
2010 Basta!: Massendaten mit ADO.NET
2010 Basta!: Massendaten mit ADO.NET2010 Basta!: Massendaten mit ADO.NET
2010 Basta!: Massendaten mit ADO.NET
 
2009 - Microsoft Springbreak: IIS, PHP & WCF
2009 - Microsoft Springbreak: IIS, PHP & WCF2009 - Microsoft Springbreak: IIS, PHP & WCF
2009 - Microsoft Springbreak: IIS, PHP & WCF
 
2009 - NRW Conf: (ASP).NET Membership
2009 - NRW Conf: (ASP).NET Membership2009 - NRW Conf: (ASP).NET Membership
2009 - NRW Conf: (ASP).NET Membership
 
2009 Dotnet Information Day: More effective c#
2009 Dotnet Information Day: More effective c#2009 Dotnet Information Day: More effective c#
2009 Dotnet Information Day: More effective c#
 
2009 - Basta!: Agiles requirements engineering
2009 - Basta!: Agiles requirements engineering2009 - Basta!: Agiles requirements engineering
2009 - Basta!: Agiles requirements engineering
 
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
2008 - TechDays PT: WCF, JSON and AJAX for performance and manageability
 
2008 - Basta!: Massendaten auf dem Client
2008 - Basta!: Massendaten auf dem Client2008 - Basta!: Massendaten auf dem Client
2008 - Basta!: Massendaten auf dem Client
 
2006 DDD4: Data access layers - Convenience vs. Control and Performance?
2006 DDD4: Data access layers - Convenience vs. Control and Performance?2006 DDD4: Data access layers - Convenience vs. Control and Performance?
2006 DDD4: Data access layers - Convenience vs. Control and Performance?
 

Último

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxComplianceQuest1
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...Health
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVshikhaohhpro
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsAndolasoft Inc
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comFatema Valibhai
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providermohitmore19
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 

Último (20)

The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
A Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docxA Secure and Reliable Document Management System is Essential.docx
A Secure and Reliable Document Management System is Essential.docx
 
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
+971565801893>>SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHAB...
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Optimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTVOptimizing AI for immediate response in Smart CCTV
Optimizing AI for immediate response in Smart CCTV
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
How To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.jsHow To Use Server-Side Rendering with Nuxt.js
How To Use Server-Side Rendering with Nuxt.js
 
HR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.comHR Software Buyers Guide in 2024 - HRSoftware.com
HR Software Buyers Guide in 2024 - HRSoftware.com
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
TECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service providerTECUNIQUE: Success Stories: IT Service provider
TECUNIQUE: Success Stories: IT Service provider
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 

2010 - Basta: ASP.NET Controls für Web Forms und MVC

  • 1. Controls im Web ASP.NET Controls für Web Forms und MVC Daniel Fisher (lennybacon) | devcoach.com
  • 2. Lennybacon.com ■ Daniel Fisher | CTO & Software Architect ■ MCP, MCTS, MCPD… daniel.fisher@devcoach.com ■ Mit-Gründer und Geschäftsführer von devcoach.com www.devcoach.com ■ Mit-Gründer und Vorstand der gemeinnützigen www.just community.de e.V. ■ Veranstalter des größten Entwickler & IT-Pro Community Events in Deutschland: www.nrwconf.de ■ Mit-Gründer und Leiter der INETA Usergroup Düsseldorf www.NetUG-NiederRhein.de ■ Mitglied im Microsoft Community Leader & Insider Program (CLIP) ■ Connected Systems Advisory Board Expertengruppe für WCF, WF & BizTalk
  • 4. devcoach.com ■ Leistungen ■ Architektur-Beratung Strukturierter und effizienter zu einer wartbaren Anwendung. ■ Software-Entwicklung Team-out-of-the-box (Near-shoring) Objektmodelle und Datenzugriff Kommunikations-Infrastrukturen Identitäts- und Berechtigungsmodelle Web 2.0 und Rich Internet Applikation ■ Coaching & Training Technologien schneller verstehen und richtig einsetzen. ■ Technologien ■ Microsoft Windows & .NET Framework ASP.NET, WCF, WF, WPF, Silverlight & Geneva ■ Kunden ■ Versicherung, Finanzindustrie, Mittelstand, Handel, Kommunikation, Softwarehersteller u.v.a. Bundesamt für Sicherheit in der Informationstechnologie, Microsoft, Dresdner Bank… Project Experience Technology Know-how devcoach®
  • 5. Agenda • Web Controls • What‘s MVC anyway? • Recap 2006 • Controls for the Microsoft Web Platform • Summary
  • 6.
  • 7. 7 Is all about Maintainablility! ■ The controls concept achieves reusability for ■ Html mark-up ■ Server-side code ■ Client-side scripts ■ Compiled code that can be reused in any ASP.NET web application.
  • 8. Controls in Code public class MyControl : Control { //… }
  • 9. Controls in Code: Usage <asp:Contol id="MyId" runat="server" />
  • 11. Web Form Cons ■ No visual way of developing server controls, generated via code.
  • 13. Concepts • Nice URLs & Routing • Process over „just add a Form“ • Loads of naming conventions • Code, Code, Code • As strongly typed as possible! • Once build, forever used…
  • 14. Concepts cont. • No Code-Behind for ASPXs • No Postbacks • No Viewstate • And last but not least „No controls out of Redmond“!
  • 15.
  • 16. Web Forms or MVC?
  • 17. Once apon a time…
  • 18. 18 Processing ■ Child control creation ■ CreateChildControls() ■ All display logic ■ OnPreRender() ■ Rendering ■ Custom: Render() ■ Composite: Nothing to do?
  • 20. First Aid ■ Response.Redirect( http://example.org); ■ Server.Transfer( http://example.org); ■ <a href=“…“>link</a> ■ Server side only events ■ AJAX
  • 21.
  • 23. 23 Postback - Lifecycle of a control Instantiate : Constructor Initialize : OnInit method and Init Event Begin Tracking View State : TrackViewState Load View State : LoadViewState method Load Postback Data : IPostBackDataHandler.LoadPostdata method Load: OnLoad method and Load event Raise Changed Events : IPostBackDataHandler.RaisePostDataChangedEvent method Raise Postback Event : IPostBackEventHandler.RaisePostBackEvent method PreRender : OnPreRender method and PreRender event Save View State : SaveViewState method Render : Render method Unload : OnUnload method and Unload event Dispose : Dispose Method
  • 24. 24 ViewState ■ ViewState is used to track and restore the state values of controls that would otherwise be lost ■ Base64 encoded - not easily readable, but not encrypted! ■ What to store ■ Integers ■ Strings ■ Floats ■ Decimals ■ Arrays of the data types stated above
  • 25. Viewstate in code [Bindable(false)] [Category("Appearance")] [DefaultValue("This is the default text.")] [Description("The text of the custom control.")] public virtual string Text { get { var o = ViewState["Text"]; return o!=null ? (string) o : "This is the default text."; } set { ViewState["Text"] = value; } }
  • 27. First Aid ■ Query Request.Form and Request.QueryString ■ Use local fields ■ most times they work fine!
  • 28.
  • 30. Binding in code public overrride OnInit( object sender, EventArgs e) { List<Person> persons = Repository<Person>.GetAll(); myControl.DataSource = persons; myControl.DataBind() }
  • 31. First Aid ■ HttpContext.Current.Items ■ Cast to ViewPage ■ Access Model ■ Cast to IEnumerable
  • 32.
  • 34. Resources ■ Images ■ Java Script ■ Styles
  • 35. Resources in code [assembly: WebResource( "devcoach.Web.UI.Controls.Busy.gif", "image/gif")] imageUrl = Page.ClientScript.GetWebResourceUrl( GetType(), "devcoach.Web.UI.Controls.Busy.gif");
  • 36. First Aid ■ Embedded ■ VirtualPathProvider ■ Routing