The Internet Encyclopedia (Volume 3)

(coco) #1

P1: JDT


WL040C-44 WL040/Bidgoli-Vol III-Ch-51 June 23, 2003 16:33 Char Count= 0


CONCLUSION 633

How ASP.NET Generates Client-Side Script
With the .NET framework, Microsoft also has significantly
changed the preferred way for supporting client-side
scripting of Web browsers. As an alternative to directly
writing script for conventional HTML pages, ASP.NET has
been enhanced to automatically generate client-side script
as required for most common client-side scripting tasks.
In particular, ASP.NET takes care of customizing client-
side scripts for kind and version of Web browser being
used to access ASP pages. This promises to save Web de-
velopers time and effort, though of course there will still
be times when programmers will want to write their own
explicit client-side scripts.
ASP.NET accomplishes automatic client-side script
generation as needed through its implementation of
ASP.NET “Server Controls.” These controls reside in
the System.Web.UI.HTMLControls and System.Web.UI.
WebControls namespaces. Items in the HTML controls
collection correspond to HTML elements but are aug-
mented with additional features, and functionality (e.g.,
form <input> elements can be configured to automati-
cally retain user modified values during self-referencing
calls to the ASP.NET page). Items in the Web controls col-
lection include user interface classes analogous to tradi-
tional Visual Basic classes (e.g., the text box class, which is
at once analogous to the Visual Basic text box class and to
HTML <input> elements of type text). The Web controls
collection also contains classes of advanced functionality,
e.g., data bound controls (DataGrid, DataList, Repeater),
a calendar control, an ad rotator control, and several form
validation controls (CompareValidator, RangeValida-
tor, RegularExpressionValidator, RequiredFieldValidator,
etc.).
Validation controls in particular tend to generate
client-side script automatically. For instance, a script au-
thor of an ASP.NET page (a typical file extension is .aspx)
can associate a RequiredFieldValidator control with an
HTML input control of type text. This will result in the
generation of client-side script (appropriate for the Web
browser), which will prevent submittal of the HTML form
until the user has entered data in the HTML input box.
The client-side script is generated entirely by the ASP.NET
host based on attributes of the relevant controls, before
the generated HTML page is sent to the browser.

Web Services
The advent of the .NET framework has also provided an
opportunity to reimplement from the ground up script-
ing practices and procedures that have grown up some-
what helter skelter since the introduction of VBScript in


  1. As an example in the area of Web applications, Mi-
    crosoft has revamped earlier work on remote scripting
    to better follow community standards such as XML and
    SOAP (Clinick, 2001). The end result is an emphasis in
    the .NET framework on tools and facilities that facilitate
    the creation and implementation of “Web services.” Web
    services, a community-driven technical approach to Web
    application design, continues the steady move of Web ap-
    plications from the static to the dynamic. When first in-
    troduced, the Web was mostly about serving static data
    formatted in HTML. Over the years, Web functionality


has become increasingly dynamic through extensions of
both Web server and Web browser functionality. Initia-
tives such as Microsoft’s Remote Scripting showed how
Web applications could even be distributed between client
and server (e.g., by allowing client-side script to instan-
tiate and use objects running on the server). .NET Web
services as implemented by Microsoft do much the same
thing as remote scripting, but by making better use of new
available community standards such as XML and SOAP.
Web services in ASP.NET are implemented through spe-
cial kinds of ASP pages (the default file extension is .asmx).
These pages include a WebService directive, which in-
forms the ASP.NET service regarding service implemen-
tation programming language and class names. Available
public methods and resources are then enumerated and
scripted in the .asmx page .NET Web services have advan-
tages over older style remote scripting approaches in that
they rely less on proprietary technologies and they utilize
HTTP POST (rather than HTTP GET, which is limited in
terms of data size communicated). By designating a par-
ticular file extension for Web services pages, ASP.NET also
facilitates development by separating conventional ASP
pages from those intended to be used for Web services.
If you request the URL of an .asmx page from your Web
browser, ASP.NET will generate and send you an HTML
page suitable for testing and debugging the functionality
of your Web service.

CONCLUSION
VBScript has been and continues to be an important pro-
gramming language. While simple and easy to implement
and having relatively low overhead, it is a rich, power-
ful, and modern structured programming language with
many of the best features of object-oriented program-
ming languages included. As a kind of VBA for the Web
it has been particularly important as the scripting lan-
guage of choice for the development of server-side ASP
pages run in the context of Microsoft’s IIS Web server.
Though less ubiquitous and general purpose (because its
not browser neutral) than JavaScript it can be useful in
certain circumstances for client-side scripting of the In-
ternet Explorer Web browser. Since 1998 and the intro-
duction of the WSH, it has been important as a power-
ful, robust, shell-like language for the Microsoft Windows
operating system. Microsoft and others continue to re-
lease additional scripting libraries and object models—
e.g., Microsoft’s recently released Windows management
information scripting library that facilitates creation of
operating system information gathering and administra-
tive scripts (Stemp et al., 2002).
On the other hand, the introduction of the more uni-
fied programming environment of the .NET framework
clearly suggests that VBScript is gradually being sup-
planted by the reunified Visual Basic.NET version of the
language. With the concurrent release of ASP.NET, VB-
Script is no longer the preferred language for creation
of new ASP applications. Even for scripting of the op-
erating system, the more comprehensive array of classes
intrinsic to the .NET framework combined with a com-
mand line utility that can compile to MSIL, makes Visual
Basic.NET the better choice in many instances. VBScript
Free download pdf