This blog is about my experiences using Web Forms 3.5, sometimes called ASP.NET 3.5.
ASP.NET is a
web application framework marketed by
Microsoft that
programmers can use to build dynamic
web sites,
web applications and
XML web services. It is part of Microsoft's
.NET platform and is the successor to Microsoft's
Active Server Pages (ASP) technology. ASP.NET is built on the
Common Language Runtime, allowing programmers to write ASP.NET code using any
Microsoft .NET language.
ASP.NET attempts to simplify developers' transition from Windows application development to web development by offering the ability to build pages composed of controls similar to a Windows user interface. A web control, such as a button or label, functions in very much the same way as its Windows counterpart: code can assign its properties and respond to its events. Controls know how to render themselves: whereas Windows controls draw themselves to the screen, web controls produce segments of HTML and JavaScript which form part of the resulting page sent to the end-user's browser.
ASP.NET encourages the programmer to develop applications using an event-driven GUI paradigm (event-driven GUI model), rather than in conventional web-scripting environments like ASP and PHP. The framework attempts to combine existing technologies such as JavaScript with internal components like "ViewState" to bring persistent (inter-request) state to the inherently stateless web environment.
Other differences compared to ASP classic are:
- Compiled code means applications run faster with more design-time errors trapped at the development stage.
- Significantly improved run-time error handling, making use of exception handling using try-catch blocks.
- Similar metaphors to Windows applications such as controls and events, which make development of rich user interfaces, previously only found on the desktop, possible.
- An extensive set of controls and class libraries allows the rapid building of applications, plus user-defined controls allow commonly used templates, such as menus. Layout of these controls on a page is easier because most of it can be done visually in most editors.
- ASP.NET leverages the multi-language capabilities of the .NET CLR, allowing web pages to be coded in VB.NET, C#, J#, etc.
- Ability to cache the whole page or just parts of it to improve performance.
- Ability to use the code-behind development model to separate business logic from presentation.
- If an ASP.NET application leaks memory, the ASP.NET runtime unloads the AppDomain hosting the erring application and reloads the application in a new AppDomain.
- Session state in ASP.NET can be saved in a SQL Server database or in a separate process running on the same machine as the web server or on a different machine. That way session values are not lost when the web server is reset or the ASP.NET worker process is recycled.
- Previous versions of ASP.NET (1.0 and 1.1) were criticized for their lack of standards compliance. The generated HTML and JavaScript sent to the client browser would not always validate against W3C/ECMA standards. In addition, the framework's browser detection feature sometimes incorrectly identified web browsers other than Microsoft's own Internet Explorer as "downlevel" and returned HTML/JavaScript to these clients with some of the features removed, or sometimes crippled or broken. However, in version 2.0, all controls generate valid HTML 4.0, XHTML 1.0 (the default) or XHTML 1.1 output, depending on the site configuration. Detection of standards-compliant web browsers is more robust and support for Cascading Style Sheets is more extensive.
- Web Server Controls: these are controls introduced by ASP.net for providing the UI for the web form. These controls are state managed controls and are WYSIWYG (What You See Is What You Get) controls.
Criticisms of ASP.NET
Active Server Pages Classic (ASP) and ASP.NET can be run side-by-side in the same web application. This approach allows developers to migrate applications slowly instead of all at once. On IIS 6.0 and lower, pages written using different versions of the ASP framework can't share Session State without the use of third-party libraries. This criticism does not apply to ASP.NET and ASP applications running side by side on IIS 7. With IIS 7, modules may be run in an integrated pipeline that allows modules written in any language to be executed for any request.[2]
In some cases ASP.NET runtime will recycle the worker process (e.g. if it becomes unresponsive or if an application runs amok and causes the worker process to use more than 60% of available RAM). It can also be configured to recycle the process proactively after a certain number of requests, time period etc. In these cases users may lose session state if the application is configured to use in-process sessions. If the application relies on session state to store authentication information (bad practice since cookie based authentication and membership is built into the framework) and the application is configured to use in-process sessions, the user may be logged out if the process is recycled.
ASP.NET 2.0 produces markup that passes W3C validation, but it is debatable as to whether this increases accessibility, one of the benefits of a semantic XHTML page + CSS representation. Several controls, such as the Login controls and the Wizard control, use HTML tables for layout by default. Microsoft has now gone some way to solve this problem by releasing the ASP.NET 2.0 CSS Control Adapters, a free add-on that produces compliant accessible XHTML+CSS markup. However, some controls still rely on JavaScript.
Development tools
Several available software packages exist for developing ASP.NET applications:
Frameworks
It is not essential to use the standard webforms development model when developing with ASP.NET. Noteworthy frameworks designed for the platform include:
History
| Date | Version | Remarks | New features |
| January 16, 2002 | 1.0 | First version
released together with Visual Studio .NET | - Object oriented web application development supporting Inheritance, Polymorphism and other standard OOP features
- Developers are no longer forced to use Server.CreateObject(...), so early-binding and type safety are possible.
- Based on Windows programming; the developer can make use of DLL class libraries and other features of the web server to build more robust applications that do more than simply rendering HTML ( i.e. exception handling )
|
| April 24, 2003 | 1.1 | released together with Windows Server 2003
released together with Visual Studio .NET 2003 | - Mobile controls
- Automatic input validation
|
| November 7, 2005 | 2.0 | codename Whidbey released together with Visual Studio 2005 and Visual Web Developer Express and SQL Server 2005 | - New data controls (GridView, FormView, DetailsView)
- New technique for declarative data access (SqlDataSource, ObjectDataSource, XmlDataSource controls)
- 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 19, 2007 | 3.5 | released together with Visual Studio 2008 | - New data controls (ListView, DataPager)
- Integrated AJAX support
- Improved support for nested master pages
- JavaScript IntelliSense and debugging
- Support for LINQ
|
Related Links
- Alternatives to .NET and IIS
- Mono - An open source, cross platform implementation of CLR, including an alternative implementation of ASP.NET.
- UltiDev Cassini Web Server - A free web server that can be redistributed with ASP.NET 1.1 and 2.0 applications.
- ASP.NET Team Member blogs