Datasheet

richer user interface but are harder to maintain because they run on so many different machines. For this
reason, people have relied on form-based applications when rich user interfaces were a necessity and
extensive support could be provided to the users.
Web Forms
To make Web page construction even easier, Visual Studio 2005 supplies Web Forms. They allow you to
build ASP.NET pages graphically in the same way that Visual Basic 6 or C++ Builder windows are cre-
ated; in other words, by dragging controls from a toolbox onto a form, then flipping over to the code
aspect of that form and writing event handlers for the controls. When you use C# to create a Web Form,
you are creating a C# class that inherits from the
Page base class and an ASP.NET page that designates
that class as its code-behind. Of course, you don’t have to use C# to create a Web Form; you can use
Visual Basic 2005 or another .NET-compliant language just as well.
In the past, the difficulty of Web development discouraged some teams from attempting it. To succeed
in Web development, you had to know so many different technologies, such as VBScript, ASP, DHTML,
JavaScript, and so on. By applying the Form concepts to Web pages, Web Forms have made Web devel-
opment considerably easier.
Web Server Controls
The controls used to populate a Web Form are not controls in the same sense as ActiveX controls. Rather,
they are XML tags in the ASP.NET namespace that the Web browser dynamically transforms into HTML
and client-side script when a page is requested. Amazingly, the Web server is able to render the same
server-side control in different ways, producing a transformation appropriate to the requestor’s particu-
lar Web browser. This means that it is now easy to write fairly sophisticated user interfaces for Web pages,
without having to worry about how to ensure that your page will run on any of the available browsers —
because Web Forms will take care of that for you.
You can use C# or Visual Basic 2005 to expand the Web Form toolbox. Creating a new server-side control
is simply a matter of implementing .NET’s
System.Web.UI.WebControls.WebControl class.
XML Web Services
Today, HTML pages account for most of the traffic on the World Wide Web. With XML, however, computers
have a device-independent format to use for communicating with each other on the Web. In the future,
computers may use the Web and XML to communicate information rather than dedicated lines and pro-
prietary formats such as Electronic Data Interchange (EDI). XML Web services are designed for a service-
oriented Web, in which remote computers provide each other with dynamic information that can be
analyzed and reformatted, before final presentation to a user. An XML Web service is an easy way for a
computer to expose information to other computers on the Web in the form of XML.
In technical terms, an XML Web service on .NET is an ASP.NET page that returns XML instead of HTML
to requesting clients. Such pages have a
code-behind DLL containing a class that derives from the
WebService class. The Visual Studio 2005 IDE provides an engine that facilitates Web service development.
An organization might choose to use XML Web services for two main reasons. The first reason is that
they rely on HTTP; XML Web services can use existing networks (HTTP) as a medium for conveying
information. The other is that because XML Web services use XML, the data format is self-describing,
nonproprietary, and platform-independent.
23
Chapter 1: .NET Architecture
24727c01.qxd:WroxPro 5/7/07 12:12 PM Page 23