Post on 31-Mar-2015
Current Popular IT IPertemuan 1
Matakuliah : T0403/Current Popular IT ITahun : 2008
Learning Outcomes
• Learner can explain ASP.NET Architecture• Learner can describe the advantages of ASP.NET• Learner can describe the flow of ASP.NET process
Bina Nusantara Copyright © Surya Sujarwo 2008
Material Outline
• Introduction of ASP.NET• Introducing ASP.NET Applications• Overview of ASP.NET• ASP.NET Architecture• Understanding Microsoft Web Technology• Making sense of .NET• Ten Tips to success with ASP.NET• Leap to Object-Oriented Programming
Bina Nusantara Copyright © Surya Sujarwo 2008
Introduction of ASP.NET
• ASP.NET is a web application framework developed and marketed by Microsoft, that programmers can use to build dynamic web sites, web applications and web services.
• First released in January 2002 with version 1.0 of the .NET Framework.
• The successor to Microsoft's Active Server Pages (ASP) technology.
• ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language.
Bina Nusantara
References: http://en.wikipedia.org/wiki/ASP.NET
Introduction of ASP.NET (Continue...)
• History:– In 1997, The research for new web application model to solve
common complains about Active Server Pages, especially with regard to separation of presentation and content and being able to write “clean” code.
– The research is done by Mark Anders, a manager on IIS Team and Scott Guthrie, Duke University graduate who join Microsoft in 1997, the initial design finished in two months around Christmas holidays in 1997.
– The initial prototype was called “XSP”, the initial development was done using Java, but it was soon decided to build the new platform on top of the Common Language Runtime (CLR) instead.
– With the move to the Common Language Runtime, XSP was re-implemented in C# (“Project Cool”) and renamed to ASP+, by this point the new platform was seen as being the successor to Active Server Pages, and intention was to provide an easy migration path for ASP developers.
Bina Nusantara References: http://en.wikipedia.org/wiki/ASP.NET
Introduction of ASP.NET (Continue...)
• History (Continue…):– ASP+ first demonstrated at ASP Connections conference
in Phoenix, Arizona on May 2, 2000. The initial beta release of ASP+ came at 2000 Professional Developers Conference on July 11, 2000 in Orlando, Florida.
– During Bill Gates ’s keynote presentation, Fujitsu demonstrated ASP+ being used in conjunction with COBOL, and other languages such Microsoft’s new Visual Basic .NET, and C#, as well as Python and Perl support by way of interoperability tools created by ActiveState.
– Once the “.NET” branding was decided on in the second half of 2000, it was decided to rename ASP+ to ASP.NET.
Bina Nusantara References: http://en.wikipedia.org/wiki/ASP.NET
Date Version
Remarks New Features
January 16, 2002
1.0 Released together with Visual Studio .NET
-OO web application-Based on Windows Programming
April 24, 2003
1.1 Released together with Windows Server 2003 and Visual Studio .NET 2003
-Mobile controls-Automatic input validation
November 7, 2005
2.0 Codename WhidbeyReleased together with Visual Studio 2005 and Visual Web Developer Expressand SQL Server 2005
-GridView, FormView, DetailsView-SqlDataSource, ObjectDataSource, XmlDataSource-Navigation controls, Master pages, Login controls, Themes, Skins, Web parts, Personalization services, Full pre-compilation, new localization technique, Support for 64-bit processors, Provider class model
November 6, 2006
3.0 Previously known as WinFXReleased as an add-on to Visual Studio 2005
-Windows Presentation Foundation (WPF) -Windows Communication Foundation (WCF) -Windows Workflow Foundation (WF) -Windows CardSpace
November 19, 2007
3.5 Released together with Visual Studio 2008
-ListView, DataPager -Integrated AJAX support -Improved support for nested master pages -Support for LINQ
Introduction of ASP.NET (Continue...)
• .NET History:
Bina Nusantara References: http://en.wikipedia.org/wiki/ASP.NET
Introduction of ASP.NET (Continue...)
• Problems with Traditional ASP:– Interpreted and Loosely-Typed Code (impede
performance, late binding)– Mixes layout (HTML) and logic (scripting code)– Limited Development and Debugging Tools (Microsoft
Visual InterDev, Macromedia Visual UltraDev)– No real state management (Session state is only
maintained if cookies supported)– Update files only when server is down (current
components locked and new one must be registered)– Obscure Configuration Settings (arduous task to port
from one server to another)
Bina Nusantara References: http://www.codeproject.com/KB/aspnet/aspnetintro.aspx, Performance Tuning and Optimizing ASP.NET Applications (Jeffrey Hasan and Kenneth Tu,2003)
Introducing ASP.NET Applications
• Benefits:– Developed using compiled code and can be written using
any .NET-compliant language including VB .NET, C# .NET and J# .NET. (Separation of Code from HTML, and Support for compiled languages)
– Built into the .NET Class Framework -> benefits from an extensive API as well as all the benefit of the .NET managed environment, including type safety, Multilanguage support, optimized memory management, and a just-in-time (JIT) compilation model that optimizes the availability and performance of the application at runtime. (Use services provided by the .NET Framework)
– Provides an extensible architecture that you can easily customize (direct access to context objects including HttpRequest, HttpApplication, and HttpSessionState objects). (State Management)
– XML-Based Configuration files
Bina Nusantara References: http://www.codeproject.com/KB/aspnet/aspnetintro.aspx, Performance Tuning and Optimizing ASP.NET Applications (Jeffrey Hasan and Kenneth Tu,2003)
Introducing ASP.NET Applications (Continue…)
• Benefits (Continue…):– The runtime engine executes in a separate process from
Internet Information Server (IIS) and it delegates HTTP requests across a range of customizable handler classes.
– Provides several ways to cache page content (full-page, partial-page) and Cache API.
– Provides sophisticated debugging and tracing abilities.– Provides several methods for authenticating clients
including Windows, Forms-based, Passport-based and standard IIS authentication (impersonation).
– Graphical Development Environment with Visual Studio. (drag-drop, full intelliSense support for code, HTML and XML)
– Update files while the server is runningBina Nusantara References: http://www.codeproject.com/KB/aspnet/aspnetintro.aspx, Performance Tuning and
Optimizing ASP.NET Applications (Jeffrey Hasan and Kenneth Tu,2003)
Introducing ASP.NET Applications (Continue…)
Bina Nusantara
ASP.NET Web site architectureReferences: Performance Tuning and Optimizing ASP.NET Applications (Jeffrey Hasan and Kenneth Tu, 2003)
Introducing ASP.NET Applications (Continue…)
• Benefits of ASP.NET Configuration:– XML-based file format (readable, can be edited with XML
Editor in Visual Studio)– Optimized access to settings (configuration settings
caches by runtime engine)– Automatic refresh when settings change– Extensible for adding custom settings– Protected settings
Bina Nusantara References: Performance Tuning and Optimizing ASP.NET Applications (Jeffrey Hasan and Kenneth Tu, 2003)
Overview Of ASP.NET
• Simple ASP.NET Page:
Bina Nusantara References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008)
Creating a new website
Overview Of ASP.NET (Continue…)
Adding a new ASP.NET Page
Bina Nusantara References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008)
Overview Of ASP.NET (Continue…)
• FirstPage.aspx
Bina Nusantara
- Directive- Code declaration
block- Server Control- Label Control- XHTML Standard
References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008)
Overview Of ASP.NET (Continue…)
• Framework Class Library– Examples:
• File class -> represent file on the hard drive.• Random class -> generate random number.• Stack class -> a simple last-in-first-out non
generic collection of objects.• Directory class -> creating, moving,
enumerating through directories and subdirectories.
• Encoder class -> Converts a set of characters into a sequence of bytes.
Bina Nusantara References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008), MSDN
Overview Of ASP.NET (Continue…)
Bina Nusantara References: MSDN
Overview Of ASP.NET (Continue…)
• Common Language Runtime– Responsible for executing application code.– The code written is compiled into MSIL. (Microsoft Intermediate
Language)– When the application execute, MSIL code compile into machine
code by JITTER (the Just-In-Time compiler). (The code compile is just the method that are actually called during execution)
– In the reality, .NET Framework understand only one language: MSIL. However, for writing application using language such as Visual Basic .NET and C# for .NET Framework because .NET Framework includes compilers for these languages that enable compilation of code using these language into MSIL.
– These other languages that supported by .NET: Ada, Apl, Caml, COBOL, Eiffel, Forth, Fortran, JavaScript, Oberon, PERL, Pascal, PHP, Python, RPG, Scheme, Small Talk, etc.
Bina Nusantara References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008)
Overview Of ASP.NET (Continue…)
• ASP.NET Controls:– Standard Controls -> buttons, input fields, labels.– Validation Controls– Rich Controls -> calendars, file upload, rotating banner,
multi-step wizards.– Data Controls– Navigation Controls -> menus, tree views.– Login Controls– WebParts Controls– HTML Controls
Bina Nusantara References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008)
Overview Of ASP.NET (Continue…)
Bina Nusantara References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008)
• Handling Control Event
Overview Of ASP.NET (Continue…)
Bina Nusantara
Add Event Handler from Source View
Add Event Handler from Properties window
References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008)
Overview Of ASP.NET (Continue…)
• View State
Bina Nusantara
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTc2ODE1OTYxNw9kFgICBA9kFgICAw8PFgIeBFRleHQFATJkZGSuffplQj7JA6gji4glg9AeFVY6yA==" />
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE" value="/wEPDwUKLTc2ODE1OTYxNw9kFgICBA9kFgICAw8PFgIeBFRleHQFATJkZGSuffplQj7JA6gji4glg9AeFVY6yA==" />References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008)
Overview Of ASP.NET (Continue…)• Show View State Size
Bina Nusantara References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008)
Overview Of ASP.NET (Continue…)
• Disable ViewState
Bina Nusantara References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008)
Overview Of ASP.NET (Continue…)• Using Code Behind Page
Bina Nusantara References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008)
Overview Of ASP.NET (Continue…)
Bina Nusantara References: ASP.NET 3.5 Unleashed (Stephen Walther, 2008)
• Using Code Behind Page (Continue…)
ASP.NET Architecture• The Nuts and Bolts of IIS and Web Application
Bina Nusantara References: Maximizing ASP.NET Real World, Object-Oriented Development (Jeffrey Putz, 2005)
Default Web Site Property of IIS
ASP.NET Architecture (Continue…)Application Configuration Dialog
Bina Nusantara References: Maximizing ASP.NET Real World, Object-Oriented Development (Jeffrey Putz, 2005)
Editing the mapping of a file extension
ASP.NET Architecture (Continue…)Specify Default documents
Bina Nusantara References: Maximizing ASP.NET Real World, Object-Oriented Development (Jeffrey Putz, 2005)
ASP.NET Architecture (Continue…)Partial List of Control, Page, Application Events and Methods
Bina Nusantara References: Maximizing ASP.NET Real World, Object-Oriented Development (Jeffrey Putz, 2005)
HttpApplication
Page Control
BeginRequest
AuthenticateRequest
AuthorizeRequest
ResolveRequestCache
Page Constructor fires
AcquireRequestState
PreRquestHandlerExecute
CreateControlCollection method
Init
trackViewState method
Init
TRackViewState method
LoadViewState method
Load
HttpApplication
Page Control
DataBind
Load
Postback event handler methods
PreRender
SaveViewState method
SaveViewState method
Render method
RenderControl method
Unload
Dispose
Unload
Dispose
ReleaseRequestState
UpdateRequestCache
EndRequest
ASP.NET Architecture (Continue…)• HttpHandler
Bina Nusantara References: Maximizing ASP.NET Real World, Object-Oriented Development (Jeffrey Putz, 2005)
ASP.NET Architecture (Continue…)Custom HttpModules
Bina Nusantara References: Maximizing ASP.NET Real World, Object-Oriented Development (Jeffrey Putz, 2005)
ASP.NET Architecture (Continue…)
The role of HttpHandlers and HttpModules in the page lifecycle
Bina Nusantara References: Maximizing ASP.NET Real World, Object-Oriented Development (Jeffrey Putz, 2005)
ASP.NET Architecture (Continue…)
ASP.NET request data flow
Bina Nusantara References: ProASP.NET 3.5 Server Controls and AJAX Components(Rob Cameron and Dale Michalk, 2008)
ASP.NET Architecture (Continue…)
Bina Nusantara References: http://www.west-wind.com/presentations/howaspnetworks/howaspnetworks.asp
Understanding Microsoft Web Technology
• Content-Creation Tools:– Microsoft Office– Expression Web– Expression Blend– Visual Web Developer
• Technologies behind Web Applications– Microsoft’s .NET 3.5
Framework– ASP.NET 3.5– ASP.NET Futures– ASP.NET 3.5 Extensions– Web Services– JavaScript and client-side
codeBina Nusantara
– ASP.NET AJAX– Dynamic HTML– Extensible Markup
Language (XML)– Silverlight– Language Integrated
Query (LINQ)– ADO.NET– SQL Server– Internet Information
Services
References: ASP.NET 3.5 For DUMMIES(Ken Cox, 2008)
Making sense of .NET
• Web Services• Compiled Code• Common Language Runtime• Truly Object Oriented• Access the Entire Window System• Proper Error Handling• Server-Side Controls• State in Nonstate Environment• Event-Driven Programming
Bina Nusantara References: Developing Web Applications with ASP.NET and C# (Hank Meyne and Scott Davis, 2002)
Ten Tips to success with ASP.NET• Stop Bashing Your Head against a Wall
– There’s a knowledge gap– The code sample is wrong– The documentation is wrong– You’re up against a bug in the .NET platform or ASP.NET
• Google Is Your Friend• Read the Reference Documentation
– Built-in online help– Web-based reference material
• Ask a Good Question, Get a Good Answer• Get Free Peer-to-Peer Support
– Join forums.asp.net– Find experts at msnews.microsoft.com
Bina Nusantara References: ASP.NET 3.5 For DUMMIES(Ken Cox, 2008)
Ten Tips to success with ASP.NET (Continue…)
• Use the Starter Kits (www.asp.net/community/projects)
• Read the Hottest Blogs (weblogs.asp.net/scottgu/)• Watch the Videos (www.asp.net/learn/)• Visit the Expert Web Sites• Use the Free Tools
– Fiddler2– Internet Explorer Developer Toolbar– Reflector– Web Development Helper
Bina Nusantara References: ASP.NET 3.5 For DUMMIES(Ken Cox, 2008)
Site Url
4GuysFromRolla http://aspnet.4guysfromrolla.com
ASP Alliance http://aspalliance.com
ASP Free www.aspfree.com
ASP.NET Developer Center
http://msdn2.microsoft.com/en-us/asp.net/default.aspx
Code Project www.codeproject.com
CodePlex www.codeplex.com
CSharp Friends www.csharpfriends.com
DotNetBips www.dotnetbips.com
Dotnetjunkies www.dotnetjunkies.com
DotNetSlackers http://dotnetslackers.com
EggHeadCafe www.eggheadcafe.com
SingingEels www.singingeels.com
Leap to Object-Oriented Programming
• Object Model
Bina Nusantara References: Maximizing ASP.NET Real World, Object-Oriented Development (Jeffrey Putz, 2005)
Old-Fashioned ASP
Getting Data in ASP.NET
Leap to Object-Oriented Programming (Continue…)
• Benefits of Splitting Application into Layers
Bina Nusantara References: Maximizing ASP.NET Real World, Object-Oriented Development (Jeffrey Putz, 2005)
Application layers for an online retailer
That’s AllThank You for the Attention
Bina Nusantara