ASP+ Frames.NET
It would bedifficult to call the original implementation of Microsoft Active Server Pages(ASPs) a framework. Other than its session support, which required HTTPcookies, ASPs were merely HTML files with the ability to run some script codeas the page was generated. Forget everything you know about ASPs from the past.ASP+, the latest piece of Microsoft’s .NET architecture, is a huge step forwardin Web application development. ASP+ brings the benefits of familiarevent-driven programming using real programming languages to the entire Web,including older and stripped-down browsers.
I have toadmit, I was stunned as I dug into the beta 1 release of ASP+. In starkcontrast to the Microsoft of yore, known for stapling together a few existingMicrosoft products and calling it a Web solution, ASP+ was reworked from theground up. The result is a framework that can, with a single-source base,target both uplevel and downlevel browsers. No longer are we restricted topseudolanguages like JScript and VBScript for development: beta 1 supportsVisual Basic and C#, with others on tap. The spaghetti code that was sodifficult to avoid in ASPs has been transformed to something manageable, likelasagna. In short, Microsoft has done what I’ve always berated them for notdoing: It used its unbelievable pool of talent to rethink a popular developmentproduct and do it right.
State of the Web
Animportant question in any Web application framework is how a client’s state ismanaged in the stateless world of the browser. The original ASP implementationhad an Achilles’ heal: HTTP cookies were required to manage session stateinformation. ASP+ does not require cookies and can purportedly manage statecorrectly across a server farm, implying that at least a chunk of the stateinformation is stored on the client’s page. Less reliance on the server forstate information translates to a more scaleable server.
Web Forms
Web Formsare the most powerful features of the ASP+ framework. Traditional Webapplications are built by chaining together Web pages or calling the same pageover and over with varying parameters, but Web Forms allows programmers to worklike we used to work before the arrival of the Web: using event-drivenprogramming. Reading the code of an ASP+ Web Form is similar to reading thecode for a Visual Basic application. If you didn’t know better, you’d read thecode and understand how the page will behave when particular events occur. Butwait, you do know better: Web pagesmay be generated on the server, but they execute on the client. How can we haveportable, event-driven code if the target browser might not even supportJavaScript? The secret is that Web Forms generate appropriate HTML 3.2 -- orbetter -- code to represent the form. If the target browser supports advancedfeatures, certain events may be handled on the client. If not, the page makes aroundtrip handles the event on the server instead. For example, if you specifythat a submit button should execute its OnClick behavior on the server, whenthe user presses the Submit button, the state of the page is restored on theserver and your OnClick handler is called.
Web Controls
Toeffectively leverage Web Forms, you need some controls. ASP+ provides WebControls that map to standard HTML objects, as well as advanced visualcontrols, data validation controls, and data binding controls. You can alsocreate your own custom Web Controls. All ASP+ controls have a namespacecomponent that ensures against namespace collisions between control libraries.The provided Web Controls make it simple to create a catalog extracted from adatabase, using a template element to specify the precise HTML layout yourequire. The simplicity of the resulting code screams “maintainability,”something missing from previous ASP versions. The code and layout can beseparated, making it easier to farm out the design portion of your site to anartist rather than a programmer.
Web Methods
Manybusiness-to-business solutions depend on providing a site’s content to acustomer or partner in a nonvisual manner. The ASP+ concept of Web Services isdesigned to tackle this problem. By developing in a .NET-compliant language andidentifying the Web-accessible methods of your object with a [WebMethod] tag,you can deliver your nonvisual content to the world. For example, a shippingcompany might expose a method that takes a shipping weight and address asinputs and returns a shipping cost as a result. These Web Methods can then becalled either via an HTTP-POST, HTTP-GET, or the new XML standard HTTP-SOAP.When developing Web Methods, Web Controls, and Web Forms, you can takeadvantage of a real debugger, complete without cross-language source debugging.No longer is Response.Write() the only means of finding problems in code.
ASP+ showsthat Microsoft finally gets the Web. By providing a framework thatsimultaneously supports advanced development techniques and downlevel browsers,ASP+ becomes the first Web development platform that I am genuinely excited touse. --Eric Binary Anderson has ledprojects at a number if enterprise software companies and is currently thesenior architect at IBT Financial (Bend, Ore.), an Internet-based trainingcompany. Contact him at ebinary@columnist.com.