【正文】
al lines, and so on. For example, h1Some Text/h1 tells the browser to display Some Text in the Heading 1 style, which uses a large, bold font. Figure 11 shows the simple HTML page in a introduced the first seed of web programming with a technology called HTML forms. HTML forms expand HTML so that it includes not only formatting tags but also tags for graphical widgets, or controls. These controls include mon ingredients such as dropdown lists, text boxes, and buttons. Here’s a sample web page created with HTML form controls:HTML forms allow web application developers to design standard input pages. When the user clicks the Submit button on the page , all the data in the input controls (in this case, the two check boxes) is patched together into one long string and sent to the web server. On the server side, a custom application receives and processes the data. Amazingly enough, the controls that were created for HTML forms more than ten years ago are still the basic foundation that you’ll use to build dynamic pages! The difference is the type of application that runs on the server side. In the past, when the user clicked a button on a form page, the information might have been ed to a set account or sent to an application on the server that used the challenging CGI (Common Gateway Interface) standard. Today, you’ll work with the much more capable and elegant understand why was created, it helps to understand the problems of otherweb development technologies. With the original CGI standard, for example, the web server must launch a pletely separate instance of the application for each web request. If the website is popular, the web server must struggle under the weight of hundreds of separate copies of the application, eventually being a victim of its own counter this problem.Microsoft developed ISAPI (Internet Server Application Programming Interface), a higherlevel programming model. ISAPI solved the performance problem but at the cost of significant plexity. Even after ISAPI developers master the tricky C++ programming language, they still lie awake at night worrying about confounding issues such as multithreading. ISAPI programming is definitely not for the never really went away. Instead, Microsoft used it to build higherlevel development platforms, such as ASP and . Both of these technologies allow developers to program dynamic web pages without worrying about the lowlevel implementation details. For that reason, both platforms have bee incredibly successful. The original ASP platform garnered a huge audience of nearly one million developers. When was first released, it generated even more interest as the centerpiece of the .NET Framework. In fact, was enthusiastically put to work in dozens of largescale mercial websites even when it was only in late having similar underpinnings, ASP and are radically different. ASP is a scriptbased programming language that requires a thorough understanding of HTML and a good deal of painful coding. , on the other hand, is an objectoriented programming model that lets you put together a web page as easily as you would build a Windows application. In many respects, it’s easier to learn than to master ASP, even though is far more the same time that serverside web development was moving through an alphabet soup of technologies, a new type of programming was gaining popularity. Developers began to experiment with the different ways they could enhance web pages by embedding multimedia and miniature applets built with JavaScript, DHTML (Dynamic HTML), and Java code. These clientside technologies don’t involve any server processing. Instead, the plete application is downloaded to the client browser, which executes it greatest problem with clientside technologies is that they aren’t supported equally by all browsers and operating systems. One of the reasons that web development is so popular in the first place is because web applications don’t require setup CDs, downloads, and other tedious (and errorprone) deployment steps. Instead, a web application can be used on any puter that has Internet access. But when developers use clientside technologies, they encounter a few familiar headaches. Suddenly, crossbrowser patibility bees a problem. Developers are forced to test their websites with different operating systems and browsers, and they might even need to distribute browser updates to their clients. In other words, the clientside model sacrifices some of the most important benefits of web that reason, is designed as a serverside technology. All code executes on the server. When the code is finished executing, the user receives an ordinary HTML page, which can be viewed in any browser. These are some other reasons for avoiding clientside programming:Isolation: Clientside code can’t access serverside resources. For example, a clientside application has no easy way to read a file or interact with a database on the server (at least not without running into problems with security and browser patibility).Security: End users can view clientside code. And once malicious users understand how an application works, they can often tamper with cases, allows you to bine the best of clientside programming with serverside programming. For example, the best controls can intelligently detect the features of the client browser. If the browser supports JavaScript, these controls will return a web page that incorporates JavaScript for a richer, more responsive user interface. However, no matter what the capabilities of the browser, your code is always executed on the limitations: To ensure optimum performance, the Web is built on stateless protocols, which means as soon as a page is sent to a user, the connection is closed and any userspecific information is discarded. ASP includes a session state feature that allows programmers to work around this problem. Using session state, a web application can retain tempo