1、外文资料原文 外文资料原文 ASP.NET Web Pages Overview You use ASP.NET Web pages as the programmable user interface for your Web application. An ASP.NET Web page presents information to the user in any browser or client device and implements application logic using server-side code. ASP.NET Web pages are: Based o
2、n Microsoft ASP.NET technology, in which code that runs on the server dynamically generates Web page output to the browser or client device. Compatible with any browser or mobile device. An ASP.NET Web page automatically renders the correct browser-compliant HTML for features such as styles, layout,
3、 and so on. Alternatively, you can design your ASP.NET Web pages to run on a specific browser such as Microsoft Internet Explorer 6 and take advantage of browser-specific features. Compatible with any language supported by the .NET common language runtime, including Microsoft Visual Basic, Microsoft
4、 Visual C#, Microsoft J#, and Microsoft JScript .NET. Built on the Microsoft .NET Framework. This provides all the benefits of the framework, including a managed environment, type safety, and inheritance. Flexible because you can add user-created and third party controls to them. Components of ASP.N
5、ET Web Pages In ASP.NET Web pages, user interface programming is divided into two pieces: the visual component and the logic. If you have worked with tools like Visual Basic and Visual C+ in the past, you will recognize this division between the visible portion of a page and the code behind the page
6、 that interacts 外文资料原文 with it. The visual element consists of a file containing static markup such as HTML or ASP.NET server controls or both. The ASP.NET Web page works as a container for the static text and controls you want to display. The logic for the ASP.NET Web page consists of code that you
7、 create to interact with the page. The code can reside either in a script block in the page or in a separate class. If the code is in a separate class file, this file is referred to as the code-behind file. The code in the code-behind file can be written in Visual Basic, Visual C#, Visual J#, or JSc
8、ript .NET. For more information about how ASP.NET Web pages are constructed, see ASP.NET Web Page Code Model. ASP.NET Web pages are compiled into a dynamic-link library (.dll) file. The first time a user browses to the .aspx page, ASP.NET automatically generates a .NET class file that represents the
9、 page and then compiles it. The .dll file runs on the server and dynamically produces the HTML output for your page. For more information on how ASP.NET applications are compiled, see ASP.NET Compilation Overview. What ASP.NET Web Pages Help You Accomplish Web application programming presents challe
10、nges that do not typically arise when programming traditional client-based applications. Among the challenges are: Implementing a rich Web user interface It can be difficult and tedious to design and implement a user interface using basic HTML facilities, especially if the page has a complex layout,
11、 a large amount of dynamic content, and full-featured user-interactive objects. Separation of client and server In a Web application, the client (browser) and server are different programs often running on different computers (and even on different operating systems). Consequently, the two halves of
12、 the application share very little information; they can communicate, but typically exchange only small chunks of simple information. 外文资料原文 Stateless execution When a Web server receives a request for a page, it finds the page, processes it, sends it to the browser, and then discards all page infor
13、mation. If the user requests the same page again, the server repeats the entire sequence, reprocessing the page from scratch. Put another way, a server has no memory of pages that it has processed page are stateless. Therefore, if an application needs to maintain information about a page, its statel
14、ess nature can become a problem. Unknown client capabilities In many cases, Web applications are accessible to many users using different browsers. Browsers have different capabilities, making it difficult to create an application that will run equally well on all of them. Complications with data ac
15、cess Reading from and writing to a data source in traditional Web applications can be complicated and resource-intensive. Complications with scalability In many cases Web applications designed with existing methods fail to meet scalability goals due to the lack of compatibility between the various c
16、omponents of the application. This is often a common failure point for applications under a heavy growth cycle. Meeting these challenges for Web applications can require substantial time and effort. ASP.NET Web pages and the ASP.NET page framework address these challenges in the following ways: Intu
17、itive, consistent object model The ASP.NET page framework presents an object model that enables you to think of your forms as a unit, not as separate client and server pieces. In this model, you can program the page in a more intuitive way than in traditional Web applications, including the ability
18、to set properties for page elements and respond to events. In addition, ASP.NET server controls are an abstraction from the physical contents of an HTML page and from the direct interaction between browser and server. In general, you can use server controls the way you might work with controls in a client application and not have to think about how to create the HTML to present and process the controls and their contents.