Applied MicrosoftNET Framework Programming in Microsoft Visual BasicNET

Part 2

ASP.NET

Chapter 5

Web Forms

In recent years, the cutting edge of software development has shifted from traditional fat client apps to Web apps. The integration of back-end systems and seamless data sharing, once the holy grail of corporate IT departments, have given way to concerns over lower total cost of ownership (TCO), zero-footprint installs, and the ability to run applications from anywhere an Internet connection is available. The number one challenge that confronts developers today? Make this software run on the Web. Unfortunately, Web programming isn t easy. Writing applications like Microsoft Word and Microsoft Excel is a well understood art form. Writing applications like eBay and Amazon.com is not. To make matters worse, Web development today is practiced with first-generation tools and technologies that have more in common with 1960s-era Dartmouth BASIC than the modern platforms and development environments that developers have become accustomed to.

Microsoft s answer to the sordid state of Web programming today is a second-generation programming model called Web Forms. The Web Forms model is part of ASP.NET, which in turn is part of the Microsoft .NET Framework. Just as Active Server Pages (ASP) revolutionized Web programming in the 1990s with an easy-to-use model for dynamically generating HTML on Web servers, ASP.NET advances the state of the art in Web programming by introducing reusable server controls that render HTML to browser clients and fire events that can be processed by server-side scripts. That s Web Forms in a nutshell: Web pages built around controls and event handlers. If the concept is alluring, the implementation is downright brilliant. Once you learn to build Web apps the Web Forms way, you ll never want to build them any other way again.

This chapter introduces the Web Forms programming model by describing how to build Web forms both with and without Visual Studio .NET. First you ll nail down the basics by building Web forms by hand. Then you ll switch to Visual Studio .NET and experience rapid application development (RAD), Internet-style. Along the way, you ll be introduced to important Web Forms programming techniques such as code-behind and dynamic control initialization.

Before you begin, it s worth noting what software you need to run this chapter s sample programs. First and foremost, you need the .NET Framework. Second, you need Microsoft Internet Information Services (IIS), which is Microsoft s Web server software. Finally, you need ASP.NET. ASP.NET is automatically installed when you install the .NET Framework SDK on a platform that supports ASP.NET. Currently those platforms include Windows 2000 and Windows XP. Be sure to install IIS before you install the Framework SDK, or you ll have to go back and install ASP.NET separately.

Категории