计算机专业ASPNET外文翻译
ASP(计算机专业)外文翻译
英文原文The Active Server Pages( ASP) is a server to carry the script plait writes the environment, using it can create to set up with circulate the development, alternant Web server application procedure. Using the ASP cans combine the page of HTML, script order to create to set up the alternant the page of Web with the module of ActiveX with the mighty and applied procedure in function that according to Web. The applied procedure in ASP develops very easily with modify.The HTML plait writes the personnel if you are a simple method that a HTML plait writes the personnel, you will discover the script of ASP providing to create to have diplomatic relation with each other page. If you once want that collect the data from the form of HTML, or use the name personalization HTML document of the customer, or according to the different characteristic in different usage of the browser, you will discover ASP providing an outstanding solution. Before, to think that collect the data from the form of HTML, have to study a plait distance language to create to set up a CGI application procedure. Now, you only some simple instruction into arrive in your HTML document, can collect from the form the data combine proceeding analysis. You need not study the complete plait distance language again or edit and translate the procedure to create to have diplomatic relation alone with each other page.Along with control to use the ASP continuously with the phonetic technique in script, you can create to set up the more complicated script. For the ASP, you can then conveniently usage ActiveX module to carry out the complicated mission, link the database for example with saving with inspectional information.If you have controlled a script language, such as VBScript, JavaScript or PERL, and you have understood the method that use the ASP.As long as installed to match the standard cowgirl in the script of ActiveX script engine, can use in the page of ASP an any a script language. Does the ASP take the Microsoft? Visual Basic? Scripting Edition ( VBScript) with Microsoft? Script? Of script engine, like this you can start the editor script immediately. PERL, REXX with Python ActiveX script engine can from the third square develops the personnel acquires. The Web develops thepersonnel if you have controlled a plait distance language, such as Visual Basic, you will discover the ASP creates a very vivid method that set up the Web application procedure quickly. Pass to face to increase in the HTML the script order any, you can create the HTML that set up the applied procedure connects. Pass to create to set up own the module of ActiveX, can will apply the business in the procedure logic seal to pack and can adjust from the script, other module or from the other procedure the mold piece that use.The usage ASP proceeds the calculating Web can convert into the visible benefits, it can make the supplier of Web provide the alternant business application but not only is to announce the contents. For example, the travel agency can compare the announcement aviation schedule makes out more; Using the script of ASP can let the customer inspect the current service, comparison expenses and prepare to book seats.Include too can lower in the Windows NT Option Microsoft in the pack Transaction Server ( MTS) on the server complexity of constructing the procedure with expenses. The MTS can resolve to develop those confidentialities strong, can ratings of and the dependable Web applies the complexity problem of the procedure. Active Server Pages modelThe browser requests from the server of Web. Hour of asp document, the script of ASP starts circulating. Then the server of Web adjusts to use the ASP, the ASP reads completely the document of the claim, carry out all scripts order any, combining to deliver the page of Web to browser.Because script is on the server but is not at the customer to carry the movement, deliver the page of Web on the browser is on the Web server born. Combining to deliver the standard HTML to browser. Because only the result that there is script returns the browser, so the server carries the not easy replication in script. The customer cans not see to create to set up them at script order that the page that view.We introduce the Basic form of the database language known as SQL, a language that allows us to query and manipulate data on computerized relational database systems. SQL has been the lingua franca for RDBMS since the early 1980s, and it is of fundamental importance for many of the concepts presented in this text. The SQLlanguage is currently in transition from the relational form (the ANSI SQL –92 standard) to a newer object-relational form (ANSI SQL -99, which was released in 1999). SQL-99 should be thought of as extending SQL-92, not changing any of the earlier valid language. Usually, the basic SQL we define matches most closely the ANSI SQL standards basic subsets, called Entry SQL -92 and core SQL-99 that are commonly implemented; our touchstone in defining basic SQL is to provide a syntax that is fully available on most of the major RDBMS products[7].We begin with an overview of SQL capabilities, and then we explain something about the multiple SQL standards and dialects and how we will deal with these in our presentation.We will learn how to pose comparable queries in SQL, using a form known as the Select statement. As we will see, the SQL select statement offers more flexibility in a number of ways than relational algebra for posing queries. However, there is no fundamental improvement in power, nothing that could not be achieved in relational algebra , given a few well-considered extensions. For this reason, experience with relational algebra gives us a good idea of what can be accomplished in SQL. At the same time, SQL and relational algebra have quite different conceptual models in a number of respects, and the insight drawn from familiarity with the relational algebra approach may enhance your understanding of SQL capabilities.The most important new feature you will encounter with SQL is the ability to pose queries interactively in a computerized environment. The SQL select statement is more complicated and difficult to master than the relatively simple relational algebra, but you should never feel list or uncertain as long as you have access to computer facilities where a few experiments can clear up uncertainties about SQL use. The interactive SQL environment discussed in the current chapter allows you to type a query on a monitor screen and get an immediate answer. Such interactive queries are sometimes called ad box queries. This term refers to the fact that an SQL select statement is meant to be composed all at once in a few type written lines and not be dependent on any prior interaction in a user session. The feature of not being dependent on prior interaction is also down as non-procedurality. SQL differs in this way even from relational algebra, where a prior alias statement might be needed inorder to represent a product of a table with itself. The difference between SQL and procedural languages such as java or c is profound: you do not need to write a program to try out an SQL query, you just have to type the relatively short, self-contained text of the query and submit it .Of course, an SQL query can be rather complex . A limited part of this full form, know as a sub-query, is defined recursively, and the full select statement form has one added clause. You should not feel intimidated by the complexity of the select statement, however. The fact that a select statement is non-procedural means that it has a lot in common with a menu driven application, where a user is expected to fill in some set of choices from a menu and then press the enter key to execute the menu choices all at once. The various clauses of the select statement correspond to menu choices: you will occasionally need all these clauses, but on not expect to use all of them every time you pose a query.Observed reliability depends on the context in which the system s used. As discussed already, the system environment cannot be specified in advance nor can the system designers place restrictions on that environment for operational systems. Different systems in an environment may react to problems in unpredictable ways, thus affecting the reliability of all of these systems. There for, even when the system has been integrated, it may be difficult to make accurate measurements of its reliability.Visual Basic Database Access prospectsWith the recent Web application software and the rapid development of the existing data stored in diverse forms, Visual Basic Database Access Solutions faces such as rapid extraction enterprises located in the internal and external business information with the multiple challenges. To this end Microsoft, a new database access strategy "unified data access" (UniversalDataAccess) strategy. "Unified data access" to provide high-performance access, including relational and non-relational data in a variety of sources, provide independent in the development of language development tools and the simple programming interface, these technologies makes enterprise integration of multiple data sources, better choice of development tools, application software, operating platforms, and will establish a maintenance easysolution possible.汉语翻译Active Server Pages(ASP)是服务器端脚本编写环境,使用它可以创建和运行动态、交互的Web 服务器应用程序。
计算机毕业设计ASP外文翻译
计算机毕业设计ASP外文翻译信息学院毕业设计科技文献翻译《The Design and Implementation of ASP WebSite News Management Systems 》《asp的网站新闻管理系统的设计与实现》姓名王磊专业软件工程学号202113880250 班级 2 班指导教师王立波12021年 9月AbstractThe use of ASP and SQL technology news site management system, to achieve the dynamic management of the news Web site, making the management of information more timely, efficient, improve the work efficiency. At the same time, the development of systems theory, systems and design features are introduced.[Key word] ASP,SQL,news management,databaseWith the popularization of Internet, more and more companies set up their own WWW sites, enterprises can display products through the website, publishing the latest developments, with users sharing and communication to establish contact with partners, as well as e-commerce. Information Management System which is an enterprise Web site an important part of it bears a double role, on the one hand, the dynamic can be used to release the new product or new development projects, on the other hand, the timely notice to their customers business performance, Progress in technology and research and development, in particular, recommend or preferential projects, products and services to attract customers, expand customer base.Management of traditional news sites in two ways, one static HTML page, update the information needed to re-create the page and then upload the page and modify the corresponding links, the efficiency of this approach is too low because we have little use. The second is based on ASP and scripting languages, dynamic Web pages and databases, through the application of procedures to deal with news, this is way more popular. However, due to the limitations of ASP allows the system itself, there are some insurmountable flaws, and technology has taken on the system performance has been greatly improved, the main performance in the following aspects:1. ASP page to open as a result of each must be compiled to explain the process, so when the page2opens in the rate of repeated there is no upgrade, and only need a page do not need to recompile compiled until the page has been modified or Web Application process restarted. This makes the speed in a number of visits has greatly improved.2. As the ASP does not provide any output data for the content of the components, so writing a database using ASP page can use the Record Set Object ADO to read records of transaction, while the ASP provided through the DataGrid, such as database and database components can be directly Contact.3. ASP support real-time application updates. Administrators do not haveto turn off the network server or even do not have to stop running the application can update the application on file. Application documents will never be locked, so even when the program runs in the paper can be overwritten. When the document is updated, the system will convert to the new moderate version.4. ASP take the \approach to the preparation of the code makes the code easier to prepare, structure more clearly, reducing the system development and maintenance of the complexity and the cost of.1 System Development Principle1.1 The System Architecture Model of ASP-based TechnologyASP is a three-tier system structure: UI Layer, Business Logic Tier anddata layer.UI layer is responsible for interaction with the user, receiving userinput and server-side data from present to clients.Business Logic Tier is responsible for receiving requests from browser requests to the data layers and at the same time the results of the requestsent to the browser. It consists of Web Forms, XML Web services and service composition components. Web Forms which is the core of the application, it is presented to customers based on data and information as well as to respond to and deal with customers and display interactive Web form generated based on information and data.Data layers to manipulate data through the layer for businesslogic to provide data services, such as storing the results of data manipulation and return to the results of data retrieval.1.2 The principle of access to the database 3Connected with the database, provide the following three kinds of ways: through ODBC connected; connected through OLEDB; directly connected with the SQL Server. Application of three kinds of ways as a result of differencesin levels, making the efficiency from low to high, high to low independence. Connected to the database for data processing, there are two kinds of ways,that is, through a Dataset to the isolation of heterogeneous data sources, and the other is a stream to read from the data source (Data Reader mode).Traditional application is to create a connection to the database, in the process is running the whole way to maintain connections to the design. taken disconnected mode data structure. When a browser requests a page to the Web server, the server to deal with this request, the requested pageand send to your browser, and then connection was disconnected until the next browser request issued. Another innovation is the introduction of a data set (Dataset). A data set is the relationship between memory map to provide high-speed data buffer. Data set of data sources know that they can be adopted by the programor transferred from the data warehouse data were generated, to fill.Regardless of where the data acquisition, data sets are the same procedurethrough the use of templates to be operated, and it's potential to use the same data buffer.2 Systems Functional Designs2.1 Systems Function StructuresThe news management system in Windows 2000 Server operating system platforms, Web server IIS, the database server for Microsoft SQL Server2000, development tools used in Microsoft Visual Studio. NET and DreamWeaver. Its work processes as follows: the user login through the authority to determinethe general user can only browse, read and query information, registered users can be completed in addition to the ordinary user, but also can enter information for news management module input, modify, and delete operations.In addition to registered users outside the system administrator can only be recorded on its own news operation for excision.2.2 Systems Function Characteristics(1) Simple, user-friendly: complete control of page layout, making information easier entry work;4many options including news categories, such as the source of departments only need to click the mouse can be completed; In addition, the follow-up message also appears allow users to clear their own operations.(2) Can be seen immediately: the handling of the press (including the entry, modify, delete) will be the corresponding column on the home page is displayed to \release, immediate results\function.(3) Function: include common site in all aspects of information management: information input, browse, delete, modify, search and other aspects, the full realization of the Web site of the real-time information management requirements.(4) To facilitate transplantation: for different enterprises, with some slight modifications need to be able to develop for the company's Web site features news management system.3 Systems Detailed DesignsCore functions of the system through a number of functional modules achieved. Specific design process is as follows:⑴ System login: The module responsible for the user are divided into general users and registered users to achieve the management of user rights.(2) News View: The module is responsible for all the news page web site lists information, including the title, type, source and date field departments, and each title has been made news a hyperlink, click the page they will be able to Jump news reader.(3) News reader: in other pages or click the title link to read into the news pages, at this time, detailed information of each information will be removed, including the content, title, keywords, and relatively fixed in accordance with the format placed in different pages region, the use of all the news about the same page layout, only the contents of the field corresponding to different In addition, the location of other pages can be dynamically placed in other components, such as web site logo, such as the page banner ads link to pictures, this can be easily to achieve the effect of illustrations in reading.(4) News Inquiry: The module provides a press inquiry, type to be selected to find the content and classification of information can quickly find the information in line with the conditions and results output.(5) News Management: The module listed in the registry is responsible for the registration page the user has issued a news and information and did not delete, the user can press to delete the article, modify. In5感谢您的阅读,祝您生活愉快。
ASP NET 概述中英文对照外文翻译文献
中英文资料对照外文翻译 概述 是一个统一的 Web 开发模型,它包括您使用尽可能少的代码生成企业级 Web 应用程序所必需的各种服务。
作为 .NET Framework 的一部分提供。
当您编写 应用程序的代码时,可以访问 .NET Framework 中的类。
您可以使用与公共语言运行库 (CLR) 兼容的任何语言来编写应用程序的代码,这些语言包括 Microsoft Visual Basic、C#、JScript .NET 和 J#。
使用这些语言,可以开发利用公共语言运行库、类型安全、继承等方面的优点的 应用程序。
包括:∙页和控件框架∙ 编译器∙安全基础结构∙状态管理功能∙应用程序配置∙运行状况监视和性能功能∙调试支持∙XML Web services 框架∙可扩展的宿主环境和应用程序生命周期管理∙可扩展的设计器环境 页和控件框架是一种编程框架,它在 Web 服务器上运行,可以动态地生成和呈现 网页。
可以从任何浏览器或客户端设备请求 网页, 会向请求浏览器呈现标记(例如 HTML)。
通常,您可以对多个浏览器使用相同的页,因为 会为发出请求的浏览器呈现适当的标记。
但是,您可以针对诸如 Microsoft Internet Explorer 6 的特定浏览器设计 网页,并利用该浏览器的功能。
支持基于 Web 的设备(如移动电话、手持型计算机和个人数字助理 (PDA))的移动控件。
网页是完全面向对象的。
在 网页中,可以使用属性、方法和事件来处理 HTML 元素。
页框架为响应在服务器上运行的代码中的客户端事件提供统一的模型,从而使您不必考虑基于 Web 的应用程序中固有的客户端和服务器隔离的实现细节。
该框架还会在页处理生命周期中自动维护页及该页上控件的状态。
使用 页和控件框架还可以将常用的 UI 功能封装成易于使用且可重用的控件。
控件只需编写一次,即可用于许多页并集成到 网页中。
ASP NET 2.0网页和Web控件-外文翻译
外文翻译毕业设计题目:基于的物业管理系统开发原文1: 2.0 Web Pagesand Web Controls译文1: 2.0 网页和Web控件原文2:The Role of Global.asax File 译文2:Global.asax文件的作用原文1 2.0 Web Pages and Web Controls U ntil now, all of the example applications in this text have focused on console-based and Windows Forms front ends. In this chapter and the next, you’ll explore how the .NET platform facilitates the construction of browser-based presentation layers. To begin, you’ll quickly review a number of key web-centric concepts (HTTP, HTML, client-side, and server-side script) and the role of the web server (including the development server, WebDev.WebServer.exe).With this web primer out of the way, the remainder of this chapter concentrates on the composition of (including the enhanced code-behind model) and how to work with web controls. As you will see, 2.0 provides a number of new web controls, a new “master page”model, and various customization techniques.The Role of HTTPWeb applications are very different animals from traditional desktop applications (to say the least).The first obvious difference is that a production-level web application will always involve at least two networked machines (of course, during development it is entirely possible to have a single machine play the role of both client and server). Given this fact, the machines in question must agree upon a particular wire protocol to determine how to send and receive data. The wire protocol that connects the computers in question is the Hypertext Transfer Protocol (HTTP).When a client machine launches a web browser (such as Netscape Navigator, Mozilla Firefox,or Microsoft Internet Explorer), an HTTP request is made to access a particular resource (such as an *.aspx or *.htm file) on the remote server machine. HTTP is a text-based protocol that is built upon a standard request/response paradigm. For example, if you navigate to www. , the browser software leverages a web technology termed Domain Name Service (DNS) that converts the registered URL into a four-part, 32-bit numerical value (aka an IP address). At this point, the browser opens a socket connection (typically via port 80) and sends the HTTP request for the default page at the website.Once the hosting web server receives the incoming HTTP request, the specified resource may contain logic that scrapes out any client-supplied input values (such as values within a text box) in order to format a proper HTTP response. Web programmers may leverage any number of technologies (CGI, ASP, , Java servlets, etc.) to dynamically generate the content to be emitted into theHTTP response. At this point, the client-side browser renders the HTML emitted from the web server.Another aspect of web development that is markedly different from traditional desktop programming is the fact that HTTP is an essentially stateless wire protocol. As soon as the web server emits a response to the client, everything about the previous interaction is forgotten. Therefore, as a web developer, it is up to you take specific steps to “remember” information (such as items in a shopping cart) about the clients who are currently logged on to your site. As you will see in the next chapter, provides numerous ways to handle state, many of which are commonplace to any web platform (session variables, cookies, and application variables) as well as some new techniques (view state, control state, and the cache).Understanding Web Applications and Web ServersA web application can be understood as a collection of files (*.htm, *.asp, *.aspx, image files, etc.) and related components (such as a .NET code library) stored within a particular set of directories on a given web server. As shown in Chapter 24, web applications have a specific life cycle and provide numerous events (such as initial startup or final shutdown) that you can hook into.A web server is a software product in charge of hosting your web applications, and it typically provides a number of related services such as integrated security, File Transfer Protocol (FTP) support, mail exchange services, and so forth. Internet Information Server (IIS) is Microsoft’s enterprise-level web server product, and as you would guess, it has intrinsic support for classic ASP as well as web applications.When you build web applications, you will often need to interact with IIS. Be aware, however, that IIS is not automatically selected when you install the Windows Server 2003 or Windows XP Professional Edition (you can’t install IIS on the Home editions of Windows). Therefore, depend ing on the configuration of your development machine, you may be required to manually install IIS before proceeding through this chapter. To do so, simply access the Add/Remove Program applet from the Control Panel folder and select Add/Remove Windows Components.Working with IIS Virtual DirectoriesA single IIS installation is able to host numerous web applications, each of which resides in a virtual directory. Each virtual directory is mapped to a physical directory on the local hard drive. Therefore,if you create a new virtual directory named CarsRUs, the outside world can navigate to this site using a URL such as (assuming your site’s IP address has been registeredwith the world at large). Under the hood, the virtual directory maps to a physical root directory such as C:\inetpub\wwwroot\AspNetCarsSite, which contains the content of the web application.When you create web applications using Visual Studio 2005, you have the option of generating a new virtual directory for the current website. However, you are also able to manually create a virtual directory by hand. For the sake of illustration, assume you wish to create a simple web application named Cars. The first step is to create a new folder on your machine to hold the collection of files that constitute this new site (e.g., C:\CodeTests\CarsWebSite).Next, you need to create a new virtual directory to host the Cars site. Simply right-click the Default Web Site node of IIS and select New ➤Virtual Directory from the context menu. This menu selection launches an integrated wizard. Skip past the welcome screen and give your website a name (Cars). Next, you are asked to specify the physical folder on your hard drive that contains the various files and images that represent this site (in this case, C:\CodeTests\CarsWebSite).The final step of the wizard prompts you for some basic traits about your new virtual directory (such as read/write access to the files it contains, the ability to view these files from a web browser, the ability to launch executables [e.g., CGI applications], etc.). For this example, the default selections are just fine (be aware that you can always modify your selections after running this tool using variousright-click Property dialog boxes integrated within IIS).译文1作者:迪诺·弗雷国籍:美国出处: 2.0 and Data-Bound Controls 2.0网页和Web控件到现在为止,本书的示例应用程序主要集中在控制台和基于Windows窗体前端。
计算机专业B-S模式 ASP 外文翻译 外文文献 英文文献 中英对照
计算机专业B-S模式 ASP 外文翻译外文文献英文文献中英对照外文翻译ENGLISHE:Develop Web application program using ASP the architecture that must first establish Web application. Now in application frequently with to have two: The architecture of C/S and the architecture of B/S.Client/server and customer end / server hold the architecture of C/S.The customer / server structure of two floor.Customer / server ( Client/Server ) model is a kind of good software architecture, it is the one of best application pattern of network. From technology, see that it is a logic concept, denote will a application many tasks of decomposing difference carry out , common completion is entire to apply the function of task. On each network main computer of web site, resource ( hardware, software and data ) divide into step, is not balanced, under customer / server structure, without the client computer of resource through sending request to the server that has resource , get resource request, so meet the resource distribution in network not balancedness. With this kind of structure, can synthesize various computers to cooperate with work, let it each can, realize the scale for the system of computer optimization ( Rightsizing ) with scale reduce to melt ( Downsizing ). Picture is as follows:It is most of to divide into computer network application into two, in which the resource and function that part supports many users to share , it is realized by server; Another part faces every user , is realized by client computer, also namely, client computer is usual to carry out proscenium function , realizes man-machine interaction through user interface , or is the application program of specific conducted user. And server usually carries out the function of backstagesupporter , manages the outside request concerning seting up, accepting and replying user that shared. For a computer, it can have double function , is being certain and momentary to carve to act as server , and again becomes client computer in another time.Customer / server type computer divide into two kinds, one side who offers service is called as server , asks one side of service to be called as customer. To be able to offer service, server one side must have certain hardware and corresponding server software; Also, customer one side must1also have certain hardware and corresponding customer software.There must be a agreement between server and customer, both sides communicate according to this agreement.Apply customer / server model in Internet service , the relation between customer and server is not immutable. Some Internet node offers service on the one hand , also gets service on the other hand from other node; It is even in one time dialogue course, mutual role also exchanges probably. As in carry out file transmission , if be called as one side who offers file server, is called as one side who gets file customer, when using get or mget order since another node takes file, can think that what self use and it is client computer , is using put or mput order to another node dispatch file can again think the machine that used self is server.Multilayer customer / server structureAlong with the development of enterprise application, recently, have again arisen a kind of new multilayer architecture, it applies customer end to divide into two minutes: Customer application and server apply. Customer application is the part of original customer application , is another and partial to have been transfered to server to apply. New customer application takes the responsibility for user interface and simple regular business logic and new server application resident core , changeable business logic. Therefore its structure has become new( Client application + Server application )/Server structure. Following picture shows:This kind of structure has solved traditional Client/Server can expand problem, have reduced customer end business logic , and have reduced the requirement of customer end for hardware. At the same time because of a lot of business logic concentrations have gone to unitary application server on, the maintenance work of application system had been also concentrated together, have eliminated the problem in the traditional structure of Client/Server that software distributes. This kind of structure is called as the architecture of B/S.Browser/Server and browser / server hold the architecture of B/S. On2essence, Browser/Server is also a kind of structure of Client/Server, it is a kind of from the traditional two levels of structural development of Client/Server come to the three-layer structural special case of Client/Server that applied on Web.In the system of Browser/Server, user can pass through browser to alot of servers that spread on network to send request. The structure of Browser/Server is maximum to have simplified the work of client computer, on client computer, need to install and deploy few customer end softwareonly , server will bear more work, for database visit and apply program carry out will in server finish.Under the three-layer architecture of Browser/Server, express layer ( Presentatioon ) , function layer ( Business Logic ) , data layer( Data Service ) have been cut the unit of 3 relative independences: It is the first layer of to express layer: Web browser.In expressing layer contain system show logic, locate in customer end. It's task is to suggest by Web browser to the certain a Web server on network that service is asked , after verifying for user identity, Web server delivers needed homepage with HTTP agreement to customer end, client computer accept the homepage file that passed , and show it in Web browser on.Second layer function layer: Have the Web server of the application function of program extension.In function layer contain the systematic handling of general affairs logic, locate in Web server end. It's task is the request concerning accepting user , need to be first conducted and corresponding to expand application program and database to carry out connection , passes through the waies such as SQL to database server to put forward data handling to apply for, then etc. database server the result of handling data submit to Web server, deliver again by Web server to return customer end.The number of plies of 3th according to layer: Database server.In data layer contain systematic data handling logic, locate in database server end. It's task is to accept the request that Web server controls for database, realization is inquired and modified fordatabase , update etc. function, submit operation result to Web server.Careful analysis is been easy to see , the architecture ofBrowser/Server of three-layer is the handling of general affairs of the two levels of structure of Client/Server logic modular from the task of client computer in split , from the first floor of individualcomposition bear the pressure of its task and such client computer have alleviated greatly, distribute load balancedly and have given Web server, so from the structural change of Client/server of original two floor the structure of Browser/Server of three-layer. This kind of three-layer architecture following picture shows.This kind of structure not only client computer from heavy burdenand3the requirement of performance that rises continuously for it in liberation come out , also defend technology people from heavy maintenance upgrading work in free oneself. Since client computerhandles general affairs , logic partial minutes have given function server, make client computer right off " slender " a lot of, do not take the responsibility for handling complex calculation and data again visit etc. crucial general affairs, is responsible to show part, so, maintenance people do not rush about again for the maintenance work ofprogram between every client computer, and put major energy in the program on function server update work. Between this kind of three-layer structural layer and layer, the mutually independent change of any first floor does not affect the function of other layer. It has changed the defect of the two levels of architecture of Client/Server of tradition from foundation, it is the transform with deep once in application systematic architecture.The contrast of two architecturesThe architecture of Browser/Server and the architecture ofClient/Server compare with all advantages that not only have the architecture of Client/Server and also have the architecture ofClinet/Server the unique advantage that place does not have: Open standard: The standard adopted by Client/Server only in department unification for but, it's application is often for special purpose.It is lower to develop and defend cost: It need to be implemented on all client computers that the application of Client/Server must develop the customer end software for special purpose, no matter installation and disposition escalate still, have wasted manpower and material resources maximumly. The application of Browser/Server need in customer end have general browser , defend and escalate to work in server end go on , need not carry out any change as customer holds , have reduced the cost of development and maintenance so greatly.It is simple to use , interface friendly: The interface of the userof Client/Server is decided by customer end software, interface and the method of its use are not identical each, per popularize a system of Client/Server ask user study from the beginning, is hard to use. The interface of the user of Browser/Server is unified on browser, browseris easy to use , interface friendly, must not study use again other software, the use of a Lao Yong Yi that has solved user problem.Customer end detumescence: The customer end of Client/Server has the function that shows and handles data , as the requirement of customerend is a client computer " it is fat " very high. The customer of Browser/Server holds the access that not takes the responsibility for database again and the etc. task of complex data calculation, need it only show , the powerful role that has played server fully is so largeto have reduced the requirement for customer end, customer end become very " thin ".4System is flexible: The 3 minutes of the system of Client/Server, in modular, have the part that need to change to want relation to the change of other modular, make system very difficult upgrading. The 3 minutes of the system of Browser/Server modular relative independence,in which a part of modular change, other modular does not get influence, it is very easy that system improve to become, and can form the system with much better performance with the product of different manufacturer.Ensure systematic safety: In the system of Client/Server, directlyjoin with database server because of client computer, user can veryeasily change the data on server, can not guarantee systematic safety. The system of Browser/Server has increased a level of Web server between client computer and database server , makes two not to be directlylinked again, client computer can not be directly controled for database, prevent user efficiently invade illegally.The architecture of Browser/Server of three-layer has the advantage that a lot of traditional architectures of Client/Server does not have , and is close to have combined the technology of Internet/Intranet, isthat the tendency of technical development tends to , it application system tape into one brand-new develop times. From this us option the configuration of B/S the architecture that develops as system.what are C/S with B/SFor " C/S " with the technology of " B/S " develop change know ,first,must make it clear that 3 problems.( 1 ) What is the structure of C/S.C/S ( Client/Server ) structure, the server structure and client computer that all know well. It is software systematic architecture, through it can hold hardware environment fully using two advantage, realize task reasonable distribution to Client end and Server end , have reduced systematic communication expense. Now, the most systems of application software are the two levels of structure of the form ofClient/Server , are developing to the Web application of distributiontype since current software application is systematic, Web and the application of Client/Server can carry out same business handling , apply different modular to share logic assembly; Therefore it is systematic that built-in and external user can visit new and existing application , through the logic in existing application system, can expand new application system. This is also present application system develop direction. Traditional C , S architecture though adopting is open pattern, but this is the openness that system develops a level , in specific application no matter Client end or5Server end the software that need to still specify support. Because of the software software that need to develop different edition according to the different system of operating system that can not offer the structure of C/S and the open environment of user genuine expectation , besides, the renovation of product is very rapid, is nearly impossible to already meet the 100 computer above users of local area network at the same time use. Price has low efficiency high. If my courtyard uses , Shanghai exceed the orchid company's management software " statistics of law case" is typical C , Sarchitecture management software.( 2 ) What is the structure of B/S.B/S ( Browser/Server ) structure browser and server structure. It is along with the technology of Internet spring up , it is for thestructure of improvement or a kind of change of the structure of C/S.Under this kind of structure, user working interface is to realize through WWW browser, lose the logic of general affairs very much infront( Browser) realization, but the major logic of general affairs in server end( Server) realization, form the three-layer claimed 3-tier structure. So, have simplified customer end computer load greatly , have alleviated system to defend workload and the cost with upgrading , have reduced the overall cost of user ( TCO ). With present technology see , local area network the network application that establishes thestructure of B/S , and under the pattern of Internet/Intranet, database application is easy to hold relatively , cost also is lower. It is that oneness goes to the development of position , can realize different people, never same place, with difference receive the way of entering ( for example LAN, WAN, Internet/Intranet etc.) visit and operate common database; It can protect data platform efficiently with management visit limits of authority, server database is also safe. Now in my courtyard, net ( Intranet ) , outer net ( Internet ) with Beijing eastern clear big company " law case and the management software of official business " is the structural management software of B/S , policemen each workingstation in local area network pass through WWW browser can realize working business. Especially in JAVA step platform language appearance after, the configuration management software of B/S is more facilitated , is shortcut, efficient.( 3 ) The management software technology of main stream.6The technology of main stream of management software technology isas management thought , have also gone through 3 develop period. First, interface technology goes to Windows graph interface ( or graph user interface GUI ) from last century DOS character interface, till Browser browser interface 3 differences develop period. Secondly, today own the browser interface of computer, is not only visual and is easy to use , what is more major is that any its style of application software based on browser platform is as, make the requirement of choosing a person for the job for operating training not high and software operability is strong , is easy to distinguish; Moreover platform architecture the file that also goes to today from past single user development , server ( F , S ) system and client computer , server ( C , S )system and browser , server ( B , S ) system.The comparison of C/S and B/SC/S and B/S is the now world two technologies of main stream ofdeveloping pattern technical configuration. C/S is that American Borland company researches and develop most early, B/S is that American Microsoft researches and develop. Now this two technologies with quilt world countries grasp , it is many that domestic company produce article with C/S and the technical development of B/S. This two technologies have the certain market share of self , is with customer crowd , each domestic enterprise says that own management software configuration technical function is powerful, advanced, convenient , the customer group that can lift , have a crowd scholar ink guest to shake flag selfcry out , advertisement flies all over the sky , may be called benevolent to see kernel, sage sees wisdomC/S configures inferior position and the advantage of software( 1 ) Application server operation data load is lightcomparatively.The database application of the most simple architecture of C/S is become by two partial groups, customer applies program and database server program. Both can be called as proscenium program and the program of backstage supporter respectively. The machine of operation database server program is also called as application server. Once server program had been started , waits the request concerning responding customer program hair at any time; Customer application program operation can be7called as customer computer on the own computer of user, in correspondence with database server, when needs carry out any operation for the data in database, customer program seeks server program voluntarily , and sends request to it, server program is regular as basis intends to make to reply, send to return result, application server operation data load is lighter.( 2 ) Data store management function relatively transparent.In database application data store management function, is carried out respectively independently by server program and customerapplication program , is regular as proscenium application can violate , and usually those different( no matter is have known still unknown )operations data, in server program, do not concentrate realization, for instance visit limits of authority, serial number can be repeated , must have customer talent establishment the rule order. It is these to own , for the last user that works on proscenium program is " transparent ", they need not be interest in ( can not usually also interfere ) the course of behind, can complete own all work. In the application of customer server configuration proscenium program not is very " thin ", troublesome matter is delivered to server and network. In the system of C/S take off , database can not become public really , professionally more competent storehouse, it gets independent special management.( 3 ) The inferior position of the configuration of C/S is high maintenance cost make investment just big.First, with the configuration of C/S, will select proper database platform to realize the genuine "unification" of database data, make the data synchronism that spreads in two lands complete deliver by database system go to manage, but the logically two operators of land will directly visit a same database to realize efficiently , have so some problems, if needs establishment the data synchronism of " real time ", the database server that must establish real time communication connection between two places and maintains two lands is online to run , network management staff will again want to defend and manage for customer end as server defends management , maintenance and complex tech support and the investment of this high needs have very high cost, maintenance task is measured.Secondly, the software of the structure of C/S of tradition need to develop the8software of different edition according to the different system of operating system , is very rapid because of the renovation of product, price is working needs high with inefficient already do not meet. In JAVA step platform language appearance after, the configuration of B/Sis more vigorous impact C/S , and forms threat and challenge for it. .The advantage of B/S configuration software( 1 ) The Maintenance of inferior position and upgrading way are simple. Now upgrading and the improvement of software system more and more frequently, the product of the configuration of B/S embodies more convenient property obviously. For one a little a little bit big unit , if systematic administrator needs , between hundreds of 1000 even last computers round trip run , efficiency and workload is to can imagine,but the configuration of B/S software needs management server have been all right , all customer ends are browser only, need not do any maintenance at all. No matter the scale of user has , is what , has how many branch will not increase any workload of maintenance upgrading , is all to operate needs to aim at server to go on; If need differently only, net server connection specially , realize long-range maintenance and upgrading and share. So client computer more and more " thin ", and server more and more " fat " is the direction of main stream of future informative development. In the future, software upgrading andmaintenance will be more and more easy , and use can more and more simple, this is for user manpower , material resources, time and cost save is obvious , it is astonishing. Therefore defend and escalate revolutionary way is the client computer " it is thin ", " is fat " server. ( 2 ) Cost reduction, it is more to select.All know windows in the computer of top of a table on nearly one Tong world, browser has become standard disposition, but on server operating system, windows is in absolute dominance position not. Current tendency is the application management software that uses the configuration of B/S all , need to install only in Linux server on , and safety is high. The so server option of operating system is many, no matter choosing those operating system, can let the most of ones use windows in order to the computer of top of a table of operating system does not get influence, this for make most popular free Linux operating system develop fast, Linux except operating9system is free besides, it is also free to link database, this kind of option is very pupular.Say, many persons on daily, "Sina website" nets , so long as having installed browser for can , and what need not know the server of " Sina website " to use is that hat operating system, and in fact the most of websites do not use windows operating wsystem really, but the computer of user is most of as installing to be windows operating system.( 3 ) Application server operation data load value comparatively. Since B/S configures management, software installation in server end ( Server ) on, it is been all right that network administrator need to manage server only, the user interface major logic of general affairs in server ( Server ) end pass through WWW browser completely realization, lose the logic of general affairs very much in front( Browser) realization, all customer ends has only browser, network administrator need to do hardware maintenance only. But application server operation data load is heavier, once occuring " server collapse " to wait for problem, consequence is unimaginable. Therefore a lot of units have database to stock server , are ready for any eventuality.原文翻译:利用ASP开发Web应用程序首先必须确立Web应用的体系结构。
ASP和net技术及数据库管理外文原文+中文翻译
服务器上运行。将程序在服务器端首次运行时进行编译,比 ASP 即时解释程序速 度上要快很多.而且是可以用任何与 . net 兼容的语言(包括 Visual Basic . net、 C# 和 JScript . net.)创作应用程序。另外,任何 ASP. net 应用程序都可以使用 整个 . net Framework。开发人员可以方便地获得这些技术的优点,其中包括托管 的 公 共 语 言 运 行 库 环 境 、 类 型 安 全 、 继 承 等 等 。 ASP. net 可 以 无 缝 地 与 WYSIWYG HTML 编辑器和其他编程工具(包括 Microsoft Visual Studio . net) 一起工作。这不仅使得 Web 开发更加方便,而且还能提供这些工具必须提供的 所有优点, 包括开发人员可以用来将服务器控件拖放到 Web 页的 GUI 和完全集 成的调试支持。 当创建 ASP. net 应用程序时,开发人员可以使用 Web 窗体或 XML Web services,或以他们认为合适的任何方式进行组合。每个功能都能得到 同一结构的支持,使您能够使用身份验证方案,缓存经常使用的数据,或者对应 用程序的配置进行自定义. 如果你从来没有开发过网站程序,那么这不适合你,你 应该至少掌握一些 HTML 语言和简单的 Web 开发术语(不过我相信如果有兴趣的 话是可以很快的掌握的)。你不需要先前的 ASP 开发经验(当然有经验更好) ,但 是你必须了解交互式 Web 程序开发的概念, 包含窗体, 脚本, 和数据接口的概念, 如果你具备了这些条件的话,那么你就可以在 的世界开始展翅高飞了。 不仅仅是 Active Server Page (ASP) 的下一个版本,而且是一种建立 在通用语言上的程序构架,能被用于一台 Web 服务器来建立强大的 Web 应用程 序。 提供许多比现在的 Web 开发模式强大的优势。 ASP. net 运行的架构分为几个阶段: 在 IIS 与 Web 服务器中的消息流动阶段。 在 ASP. net 网页中的消息分 派。 在 ASP. net 网页中的消息处理。 ASP. net 的原始设计构想,就是要让开发人员能够像 VB 开发工具那样,可 以使用事件驱动式程序开发模式 (Event-Driven Programming Model) 的方法来 开发网页与应用程序,若要以 ASP 技术来做到这件事的话,用必须要使用大量的 辅助信息,像是查询字符串或是窗体字段数据来识别与判断对象的来源、事件流 向以及调用的函数等等,需要撰写的代码量相当的多,但 ASP. net 很巧妙利用窗 体字段和 JavaScript 脚本把事件的传递模型隐藏起来了。 在 ASP. net 运行的时候, 经常会有网页的来回动作 (round-trip), 在 ASP. net 中称为 PostBack,在传统的 ASP 技术上,判断网页的来回是需要由开发人员自 行撰写,到了 ASP. net 时,开发人员可以用 Page.IsPostBack 机能来判断是否 为第一次运行 (当 发现 HTTP POST 要求的数据是空值时), 它可以保 证 ASP. net 的控件事件只会运行一次,但是它有个缺点(基于 HTTP POST 本 身的缺陷) ,就是若用户使用浏览器的刷新功能 (按 F5 或刷新的按钮) 刷新网页 时,最后一次运行的事件会再被运行一次,若要避免这个状况,必须要强迫浏览 器清空高速缓存才可以。
asp net外文文献及翻译
间。
ASP Classic Note 在先前的ASP中�你仅仅能够访问五个标准类。相比之下 提供超过 3,400个类! 一个命名空间包含一组逻辑的类。举例来说�涉及到与文件系统协同工作的类就 集合在System.IO 命名空间中。 命名空间被组织成一个层次结构(一棵逻辑树) 。 树根就是SYSTEM 命名空间。 这个命名空间包含基本的数据类型的所有的类,例如�字符串、数组�还包含提供随 机数字和日期的类。 你通过完整的类的命名空间能唯一识别任何的类在.NET framework中的位置。 举例来说,指定找到一个the File class 类�按如下操:
添加页面的代码 第二个难点就是页面的代码�他是确切的页面的程序代码,在你添加的 程序用户处理控件也页面事件。 如果一个使用者单击 HTML窗体中的Button按钮� 举例来说�那个按钮就会响 应一个事件 (单击事件) 。 典型地�你想添加代码响应这个事件到页面中。 举例来 说�当某人单击Button按钮控件的时候�你可以保存窗体数据到一个文件或者数据库。 控件不是唯一的能相应事件的事物。 当它被请求的时候一个 页面每次
最后�大多数的编程语言有相似的数据变量类型。 以大多数的语言�你有设定 字符串类型和整型数据类型的方法。举例来说� 整型数据最大值和最小值可能依赖 语言的种类�但是基本的数据类型是相同的。
对于多种语言来说维持这一功能需要很大的工作量。 为什么继续再创轮子? 对 所有的语言创建这种功能一次�然后把这个功能用在每一种语言中岂不是更容易。
最重要地, 写这一本书的目的, .NET类库包含构建的 页面的类。然而 你需要了解当你构建.NET页面的时候能够访问.NET framework 的任意类。
理解命名空间 正如你猜测的, .NET framework是庞大的。 它包含数以千计的类(超过 3,400) 。 幸运地�类不是简单的堆在一起。.NET framework的类被组织成有层次结构的命名空
软件 外文翻译 外文文献 英文文献 ASP NET 概述
英文原文 Overview is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of coding. is part of the .NET Framework, and when coding applications you have access to classes in the .NET Framework. You can code your applications in any language compatible with the common language runtime (CLR), including Microsoft Visual Basic, C#, JScript .NET, and J#. These languages enable you to develop applications that benefit from the common language runtime, type safety, inheritance, and so on. includes:A page and controls frameworkThe compilerSecurity infrastructureState-management facilitiesApplication configurationHealth monitoring and performance featuresDebugging supportAn XML Web services frameworkExtensible hosting environment and application life cycle managementAn extensible designer environmentThe page and controls framework is a programming framework that runs on a Web server to dynamically produce and render Web pages. Web pages can be requested from any browser or client device, and renders markup (such as HTML) to the requesting browser. Web pages are completely object-oriented. Within Web pages you can work with HTML elements using properties, methods, and events. The page framework removes the implementation details of the separation of client and server inherent in Web-based applications by presenting a unified model forresponding to client events in code that runs at the server. The framework also automatically maintains the state of a page and the controls on that page during the page processing life cycle.The page and controls framework also enables you to encapsulate common UI functionality in easy-to-use, reusable controls. Controls are written once, can be used in many pages, and are integrated into the Web page that they are placed in during rendering.The page and controls framework also provides features to control the overall look and feel of your Web site via themes and skins. You can define themes and skins and then apply them at a page level or at a control level.All code is compiled, which enables strong typing, performance optimizations, and early binding, among other benefits. Once the code has been compiled, the common language runtime further compiles code to native code, providing improved performance. includes a compiler that will compile all your application components including pages and controls into an assembly that the hosting environment can then use to service user requests.In addition to the security features of .NET, provides an advanced security infrastructure for authenticating and authorizing user access as well as performing other security-related tasks. You can authenticate users using Windows authentication supplied by IIS, or you can manage authentication using your own user database using forms authentication and membership. Additionally, you can manage the authorization to the capabilities and information of your Web application using Windows groups or your own custom role database using roles. You can easily remove, add to, or replace these schemes depending upon the needs of your application. always runs with a particular Windows identity so you can secure your application using Windows capabilities such as NTFS Access Control Lists (ACLs), database permissions, and so on. For more information on the identity of , provides intrinsic state management functionality that enables you tostore information between page requests, such as customer information or the contents of a shopping cart. You can save and manage application-specific, session-specific, page-specific, user-specific, and developer-defined information. This information can be independent of any controls on the page. offers distributed state facilities, which enable you to manage state information across multiple instances of the same application on one computer or on several computers. applications use a configuration system that enables you to define configuration settings for your Web server, for a Web site, or for individual applications. You can make configuration settings at the time your applications are deployed and can add or revise configuration settings at any time with minimal impact on operational Web applications and servers. configuration settings are stored in XML-based files. Because these XML files are ASCII text files, it is simple to make configuration changes to your Web applications. You can extend the configuration scheme to suit your requirements. includes features that enable you to monitor health and performance of your application. health monitoring enables reporting of key events that provide information about the health of an application and about error conditions. These events show a combination of diagnostics and monitoring characteristics and offer a high degree of flexibility in terms of what is logged and how it is logged. supports two groups of performance counters accessible to your applications:The system performance counter groupThe application performance counter group takes advantage of the run-time debugging infrastructure to provide cross-language and cross-computer debugging support. You can debug both managed and unmanaged objects, as well as all languages supported by the common language runtime and script languages.In addition, the page framework provides a trace mode that enablesyou to insert instrumentation messages into your Web pages. supports XML Web services. An XML Web service is a component containing business functionality that enables applications to exchange information across firewalls using standards like HTTP and XML messaging. XML Web services are not tied to a particular component technology or object-calling convention. As a result, programs written in any language, using any component model, and running on any operating system can access XML Web services. includes an extensible hosting environment that controls the life cycle of an application from when a user first accesses a resource (such as a page) in the application to the point at which the application is shut down. While relies on a Web server (IIS) as an application host, provides much of the hosting functionality itself. The architecture of enables you to respond to application events and create custom HTTP handlers and HTTP modules.Introduction to the C# Language and the .NET Framework C# is an elegant and type-safe object-oriented language that enables developers to build a wide range of secure and robust applications that run on the .NET Framework. You can use C# to create traditional Windows client applications, XML Web services, distributed components, client-server applications, database applications, and much, much more. Microsoft Visual C# 2005 provides an advanced code editor, convenient user interface designers, integrated debugger, and many other tools to facilitate rapid application development based on version 2.0 of the C# language and the .NET Framework.The Visual C# documentation assumes that you have an understanding of basic programming concepts. If you are a complete beginner, you might want to explore Visual C# Express Edition, which is available on the Web. You can also take advantage of any of several excellent books and Web resources on C# to learn practical programming skills.C# syntax is highly expressive, yet with less than 90 keywords, it is also simple and easy to learn. The curly-brace syntax of C# will be instantly recognizable to anyone familiar with C, C++ or Java. Developers who know any of these languages are typically able to begin working productively in C# within a very short time. C#syntax simplifies many of the complexities of C++ while providing powerful features such as nullable value types, enumerations, delegates, anonymous methods and direct memory access, which are not found in Java. C# also supports generic methods and types, which provide increased type safety and performance, and iterators, which enable implementers of collection classes to define custom iteration behaviors that are simple to use by client code.As an object-oriented language, C# supports the concepts of encapsulation, inheritance and polymorphism. All variables and methods, including the Main method, the application's entry point, are encapsulated within class definitions. A class may inherit directly from one parent class, but it may implement any number of interfaces. Methods that override virtual methods in a parent class require the override keyword as a way to avoid accidental redefinition. In C#, a struct is like a lightweight class; it is a stack-allocated type that can implement interfaces but does not support inheritance.In addition to these basic object-oriented principles, C# facilitates the development of software components through several innovative language constructs, including:C# programs run on the .NET Framework, an integral component of Windows that includes a virtual execution system called the common language runtime (CLR) and a unified set of class libraries. The CLR is Microsoft's commercial implementation of the common language infrastructure (CLI), an international standard that is the basis for creating execution and development environments in which languages and libraries work together seamlessly.Source code written in C# is compiled into an intermediate language (IL) that conforms to the CLI specification. The IL code, along with resources such as bitmaps and strings, is stored on disk in an executable file called an assembly, typically with an extension of .exe or .dll. An assembly contains a manifest that provides information on the assembly's types, version, culture, and security requirements.中文翻译 概述 是一个统一的Web 开发模型,它包括您使用尽可能少的代码生成企业级Web 应用程序所必需的各种服务。
外文翻译---ASPNET介绍以及内联代码和共享
附录 1 英文原文Introduction to Pages and Inline Code and Share[10] The Web Forms page framework is a scalable common language runtime programming model that can be used on the server to dynamically generate Web pages. Intended as a logical evolution of ASP ( provides syntax compatibility with existing pages), the page framework has been specifically designed to address a number of key deficiencies in the previous model. In particular, it provides the ability to create and use reusable UI controls that can encapsulate common functionality and thus reduce the amount of code that a page developer has to write, the ability for developers to cleanly structure their page logic in an orderly fashion (not "spaghetti code"), and the ability for development tools to provide strong WYSIWYG design support for pages (existing classic ASP code is opaque to tools). This section of the QuickStart provides a high-level code walkthrough of some basic page features. Subsequent sections of the QuickStart drill down into more specific details. pages are text files with an .htm file name extension. Pages consist of code and markup and are dynamically compiled and executed on the server to produce a rendering to the requesting client browser (or device). They can be deployed throughout an IIS virtual root directory tree. When a browser client requests .htm resources, the runtime parses and compiles the target file into a .NET Framework class. This class can then be used to dynamically process incoming requests. (Note that the .htm file is compiled only the first time it is accessed; the compiled type instance is then reused across multiple requests).An page can be created simply by taking an existing HTML file and changing its file name extension to .htm (no modification of code is required). For example, the following sample demonstrates a simple HTML page that collects a user's name and category preference and then performs a form postback to the originating page when a button is clicked:Important: Note that nothing happens yet when you click the Lookup button. Thisis because the .htm file contains only static HTML (no dynamic content). Thus, the same HTML is sent back to the client on each trip to the page, which results in a loss of the contents of the form fields (the text box and drop-down list) between requests. provides syntax compatibility with existing ASP pages. This includes support for <% %> code render blocks that can be intermixed with HTML content within an .htm file. These code blocks execute in a top-down manner at page render time.The below example demonstrates how <% %> render blocks can be used to loop over an HTML block (increasing the font size each time):Important: Unlike with ASP, the code used within the above <% %> blocks is actually compiled--not interpreted using a script engine. This results in improved runtime execution performance. page developers can utilize <% %> code blocks to dynamically modify HTML output much as they can today with ASP. For example, the following sample demonstrates how <% %> code blocks can be used to interpret results posted back from a client.Important: While <% %> code blocks provide a powerful way to custom manipulate the text output returned from an page, they do not provide a clean HTML programming model. As the sample above illustrates, developers using only <% %> code blocks must custom manage page state between round trips and custom interpret posted values.In addition to code and markup, pages can contain server controls, which are programmable server-side objects that typically represent a UI element in the page, such as a textbox or image. Server controls participate in the execution of the page and produce their own markup rendering to the client. The principle advantage of server controls is that they enable developers to get complex rendering and behaviors from simple building-block components, dramatically reducing the amount of code it takes to produce a dynamic Web page. Another advantage of server controls is that it is easy to customize theirrendering or behavior. Server controls expose properties that can be set either declaratively (on the tag) or programmatically (in code). Server controls (and the page itself) also expose events that developers can handle to perform specific actions during the page execution or in response to a client-side action that posts the page back to the server (a "postback"). Server controls also simplify the problem of retaining state across round-trips to the server, automatically retaining their values across successive postbacks.Server controls are declared within an .htm file using custom tags or intrinsic HTML tags that contain a runat="server" attribute value. Intrinsic HTML tags are handled by one of the controls in the System.Web.UI.HtmlControls namespace. Any tag that doesn't explicitly map to one of the controls is assigned the type of System.Web.UI.HtmlControls.HtmlGenericControl.Important: Note that these server controls automatically maintain anyclient-entered values between round trips to the server. This control state is not stored on the server (it is instead stored within an <input type="hidden"> form field that is round-tripped between requests). Note also that no client-side script is required.In addition to supporting standard HTML input controls, enables developers to utilize richer custom controls on their pages. For example, the following sample demonstrates how the <asp:adrotator> control can be used to dynamically display rotating ads on a page.Each server control is capable of exposing an object model containing properties, methods, and events. developers can use this object model to cleanly modify and interact with the page.Note, however, how much cleaner and easier the code is in this new server-control-based version. As we will see later in the tutorial, the page Framework also exposes a variety of page-level events that you can handle to write code to execute a specific time during the processing of the page. Examples of these events are Page_Load and Page_Render.The example below demonstrates a simple page with three servercontrols, a TextBox, Button, and a Label. Initially these controls just render their HTML form equivalents. However, when a value is typed in the TextBox and the Button is clicked on the client, the page posts back to the server and the page handles this click event in the code of the page, dynamically updating the Text property of the Label control. The page then re-renders to reflect the updated text. This simple example demonstrates the basic mechanics behind the server control model that has made one of the easiest Web programming models to learn and master.Note that in the preceding example the event handler for the Button was located between <script></script>tags in the same page containing the server controls. calls this type of page programming code-inline, and it is very useful when you want to maintain your code and presentation logic in a single file. However, also supports another way to factor your code and presentation content, called the code-behind model. When using code-behind, the code for handling events is located in a physically separate file from the page that contains server controls and markup. This clear delineation between code and content is useful when you need to maintain these separately, such as when more than one person is involved in creating the application. It is often common in group projects to have designers working on the UI portions of an application while developers work on the behavior or code. The code-behind model is well-suited to that environment. 2.0 introduces an improved runtime for code-behind pages that simplifies the connections between the page and code. In this new code-behind model, the page is declared as a partial class, which enables both the page and code files to be compiled into a single class at runtime. The page code refers to the code-behind file in the CodeFile attribute of the <%@ Page %>directive, specifying the class name in the Inherits attribute. Note that members of the code behind class must be either public or protected (they cannot be private).The advantage of the simplified code-behind model over previous versions is that you do not need to maintain separate declarations of server control variablesin the code-behind class. Using partial classes (new in 2.0) allows the server control IDs of the ASPX page to be accessed directly in the code-behind file. This greatly simplifies the maintenance of code-behind pages.Although you can place code inside each page within your site (using the inline or code-behind separation models described in the previous section), there are times when you will want to share code across several pages in your site. It would be inefficient and difficult to maintain this code by copying it to every page that needs it. Fortunately, provides several convenient ways to make code accessible to all pages in an application.Just as pages can be compiled dynamically at runtime, so can arbitrary code files (for example .cs or .vb files). 2.0 introduces the App_Code directory, which can contain standalone files that contain code to be shared across several pages in your application. Unlike 1.x, which required these files to be precompiled to the Bin directory, any code files in the App_Code directory will be dynamically compiled at runtime and made available to the application. It is possible to place files of more than one language under the App_Code directory, provided they are partitioned in subdirectories (registered with a particular language in Web.config). The example below demonstrates using the App_Code directory to contain a single class file called from the page.By default, the App_Code directory can only contain files of the same language. However, you may partition the App_Code directory into subdirectories (each containing files of the same language) in order to contain multiple languages under the App_Code directory. To do this, you need to register each subdirectory in the Web.config file for the application.<configuration><system.web><compilation><codeSubDirectories><add directoryName="Subdirectory"/></codeSubDirectories></compilation></system.web></configuration>Supported in version 1, the Bin directory is like the Code directory, except it can contain precompiled assemblies. This is useful when you need to use code that is possibly written by someone other than yourself, where you don't have access to the source code (VB or C# file) but you have a compiled DLL instead. Simply place the assembly in the Bin directory to make it available to your site. By default, all assemblies in the Bin directory are automatically loaded in the app and made accessibe to pages. You may need to Import specific namespaces from assemblies in the Bin directory using the @Import directive at the top of the page.The .NET Framework 2.0 includes a number of assemblies that represent the various parts of the Framework. These assemblies are stored in the global assembly cache, which is a versioned repository of assemblies made available to all applications on the machine (not just a specific application, as is the case with Bin and App_Code). Several assemblies in the Framework are automatically made available to applications. You can register additional assemblies by registration in a Web.config file in your application.<configuration><compilation><assemblies><add assembly="System.Data, Version=1.0.2411.0,Culture=neutral,PublicKeyToken=b77a5c561934e089"/></assemblies></compilation></configuration>附录 2 中文译文介绍以及内联代码和共享 Web 窗体页框架是一种可用于在服务器上动态生成网页的可伸缩公共语言运行库编程模型。
ASP外文翻译原文
毕业设计(论文)外文参考资料及译文译文题目:《技术》学生姓名:陈韡学号: 1205201005 专业:计算机科学与技术(专转本)所在学院:计算机工程学院指导教师:朱勇职称:教授2016年 3月 16日ASP. Net Technology——download from CSDN is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of coding. is part of the .NET Framework, and when coding applications you have access to classes in the .NET Framework. You can code your applications in any language compatible with the common language runtime (CLR), including Microsoft Visual Basic, C#, JScript .NET, and J#. These languages enable you to develop applications that benefit from the common language runtime, type safety, inheritance, and so on. includes:∙ A page and controls framework∙The compiler∙Security infrastructure∙State-management facilities∙Application configuration∙Health monitoring and performance features∙Debugging support∙An XML Web services framework∙Extensible hosting environment and application life cycle management∙An extensible designer environmentThe page and controls framework is a programming framework that runs on a Web server to dynamically produce and render Web pages. Web pages can be requested from any browser or client device, and renders markup (such as HTML) to the requesting browser. As a rule, you can use the same page for multiple browsers, because renders the appropriate markup for the browser making the request. However, you can designyour Web page to target a specific browser, such as Microsoft Internet Explorer 6, and take advantage of the features of that browser. supports mobile controls for Web-enabled devices such as cellular phones, handheld computers, and personal digital assistants (PDAs). Web pages are completely object-oriented. Within Web pages you can work with HTML elements using properties, methods, and events. The page framework removes the implementation details of the separation of client and server inherent in Web-based applications by presenting a unified model for responding to client events in code that runs at the server. The framework also automatically maintains the state of a page and the controls on that page during the page processing life cycle.The page and controls framework also enables you to encapsulate common UI functionality in easy-to-use, reusable controls. Controls are written once, can be used in many pages, and are integrated into the Web page that they are placed in during rendering.The page and controls framework also provides features to control the overall look and feel of your Web site via themes and skins. You can define themes and skins and then apply them at a page level or at a control level.In addition to themes, you can define master pages that you use to create a consistent layout for the pages in your application. A single master page defines the layout and standard behavior that you want for all the pages (or a group of pages) in your application. You can then create individual content pages that contain the page-specific content you want to display. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page.All code is compiled, which enables strong typing, performance optimizations, and early binding, among other benefits. Once the code has beencompiled, the common language runtime further compiles code to native code, providing improved performance. includes a compiler that will compile all your application components including pages and controls into an assembly that the hosting environment can then use to service user requests.In addition to the security features of .NET, provides an advanced security infrastructure for authenticating and authorizing user access as well as performing other security-related tasks. You can authenticate users using Windows authentication supplied by IIS, or you can manage authentication using your own user database using forms authentication and membership. Additionally, you can manage the authorization to the capabilities and information of your Web application using Windows groups or your own custom role database using roles. You can easily remove, add to, or replace these schemes depending upon the needs of your application. always runs with a particular Windows identity so you can secure your application using Windows capabilities such as NTFS Access Control Lists (ACLs), database permissions, and so on. For more information on the identity of , provides intrinsic state management functionality that enables you to store information between page requests, such as customer information or the contents of a shopping cart. You can save and manage application-specific, session-specific, page-specific, user-specific, and developer-defined information. This information can be independent of any controls on the page. offers distributed state facilities, which enable you to manage state information across multiple instances of the same application on one computer or on several computers. applications use a configuration system that enables you to define configuration settings for your Web server, for a Web site, or for individual applications. You can make configuration settings at the time your applications are deployed and can add or revise configuration settings at any time with minimal impact on operational Web applications and servers. configuration settings are stored in XML-based files. Because these XML files are ASCII text files, it is simple to make configuration changes to your Web applications. You can extend the configuration scheme to suit your requirements. includes features that enable you to monitor health and performance of your application. health monitoring enables reporting of key events that provide information about the health of an application and about error conditions. These events show a combination of diagnostics and monitoring characteristics and offer a high degree of flexibility in terms of what is logged and how it is logged. supports two groups of performance counters accessible to your applications:∙The system performance counter group∙The application performance counter group takes advantage of the run-time debugging infrastructure to provide cross-language and cross-computer debugging support. You can debug both managed and unmanaged objects, as well as all languages supported by the common language runtime and script languages.In addition, the page framework provides a trace mode that enables you to insert instrumentation messages into your Web pages. supports XML Web services. An XML Web service is a component containing business functionality that enables applications to exchange information across firewalls using standards like HTTP and XML messaging. XML Web services are not tied to a particular component technology or object-calling convention. As a result, programs written in any language, using any component model, and running on any operating system can access XML Web services. includes an extensible hosting environment that controls the life cycle of an application from when a user first accesses a resource (such as a page) in the application to the point at which the application is shut down. While relies on a Web server (IIS) as an application host, provides much of the hosting functionality itself. The architecture of enables you to respond to application events and create custom HTTP handlers and HTTP modules. includes enhanced support for creating designers for Web server controls for use with a visual design tool such as Visual Studio. Designers enable you to build a design-time user interface for a control, so that developers can configure your control's properties and content in the visual design tool.Introduction to the C# Language and the .NET Framework C# is an elegant and type-safe object-oriented language that enables developers to build a wide range of secure and robust applications that run on the .NET Framework. You can use C# to create traditional Windows client applications, XML Web services, distributed components, client-server applications, database applications, and much, much more. Microsoft Visual C# 2005 provides an advanced code editor, convenient user interface designers, integrated debugger, and many other tools to facilitate rapid application development based on version 2.0 of the C# language and the .NET Framework.NoteC# syntax is highly expressive, yet with less than 90 keywords, it is also simple and easy to learn. The curly-brace syntax of C# will be instantly recognizable to anyone familiar with C, C++ or Java. Developers who know any of these languages are typically able to begin working productively in C# within a very short time. C# syntax simplifies many of the complexities of C++ while providing powerful features such as nullable value types, enumerations, delegates, anonymous methods and direct memory access, which are not found in Java. C# also supports generic methods and types, which provide increased type safety and performance, and iterators, which enable implementers of collection classes to define custom iteration behaviors that are simple to use by client code.As an object-oriented language, C# supports the concepts of encapsulation, inheritance and polymorphism. All variables and methods, including the Main method, the application's entry point, are encapsulated within class definitions. A class may inherit directly from one parent class, but it may implement any number of interfaces. Methods that override virtual methods in a parent class require the override keyword as a way to avoid accidental redefinition. In C#, a struct is like a lightweight class; it is a stack-allocated type that can implement interfaces but does not support inheritance.In addition to these basic object-oriented principles, C# facilitates the development of software components through several innovative language constructs, including:∙Encapsulated method signatures called delegates, which enable type-safe event notifications.∙Properties, which serve as accessors for private member variables.∙Attributes, which provide declarative metadata about types at run time.∙Inline XML documentation comments.If you need to interact with other Windows software such as COM objects or native Win32 DLLs, you can do this in C# through a process called "Interop." Interopenables C# programs to do just about anything that a native C++ application can do. C# even supports pointers and the concept of "unsafe" code for those cases in which direct memory access is absolutely critical.The C# build process is simple compared to C and C++ and more flexible than in Java. There are no separate header files, and no requirement that methods and types be declared in a particular order. A C# source file may define any number of classes, structs, interfaces, and events.C# programs run on the .NET Framework, an integral component of Windows that includes a virtual execution system called the common language runtime (CLR) and a unified set of class libraries. The CLR is Microsoft's commercial implementation of the common language infrastructure (CLI), an international standard that is the basis for creating execution and development environments in which languages and libraries work together seamlessly.Source code written in C# is compiled into an intermediate language (IL) that conforms to the CLI specification. The IL code, along with resources such as bitmaps and strings, is stored on disk in an executable file called an assembly, typically with an extension of .exe or .dll. An assembly contains a manifest that provides information on the assembly's types, version, culture, and security requirements.When the C# program is executed, the assembly is loaded into the CLR, which might take various actions based on the information in the manifest. Then, if the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code into native machine instructions. The CLR also provides other services related to automatic garbage collection, exception handling, and resource management. Code that is executed by the CLR is sometimes referred to as "managed code," in contrast to "unmanaged code" which is compiled into native machine language that targets a specific system. The following diagram illustrates the compile-time and run time relationships of C# source code files, the base class libraries, assemblies, and the CLR.Language interoperability is a key feature of the .NET Framework. Because the IL code produced by the C# compiler conforms to the Common Type Specification (CTS), IL code generated from C# can interact with code that was generated from the .NET versions of Visual Basic, Visual C++, Visual J#, or any of more than 20 other CTS-compliant languages. A single assembly may contain multiple modules written in different .NET languages, and the types can reference each other just as if they were written in the same language.In addition to the run time services, the .NET Framework also includes an extensive library of over 4000 classes organized into namespaces that provide a wide variety of useful functionality for everything from file input and output to string manipulation to XML parsing, to Windows Forms controls. The typical C# application uses the .NET Framework class library extensively to handle common "plumbing" chores.中文一译文:技术——下载自CSDN网站 是一个统一的 Web 开发模型,它包括您使用尽可能少的代码生成企业级 Web 应用程序所必需的各种服务。
探究ASP.NET MVC 毕业论文 外文翻译中英文对照
MVC In-Depth: The Life of an MVC RequestThe purpose of this blog entry is to describe, in painful detail, each step in the life of an MVC request from birth to death. I want to understand everything that happens when you type a URL in a browser and hit the enter key when requesting a page from an MVC website. Why do I care? There are two reasons. First, one of the promises of MVC is that it will be a very extensible framework. For example, you’ll be able to plug in different view engines to control how your website content is rendered. You also will be able to manipulate how controllers get generated and assigned to particular requests. I want to walk through the steps involved in an MVC page request because I want to discover any and all of these extensibility points. Second, I’m interested in Test-Driven Development. In order to write unit tests for controllers, I need to understand all of the controller dependencies. When writing my tests, I need to mockce rtain objects using a mocking framework such as Typemock Isolator or Rhino Mocks. If I don’t understand the page request lifecycle, I won’t be able to effectively mock it.Two WarningsBut first, two warnings.Here's the first warning: I’m writing this blo g entry a week after the MVC Preview 2 was publicly released. The MVC framework is still very much in Beta. Therefore, anything that I describe in this blog entry might be outdated and, therefore, wrong in a couple of months. So, if you are reading this blog entry after May 2008, don’t believe everything you read. Second, this blog entry is not meant as an overview of MVC. I describe the lifecycle of an MVC request in excruciating and difficult to read detail. Okay, you have been warned.Overview of the Lifecycle StepsThere are five main steps that happen when you make a request from an MVC website: 1. Step 1 – The RouteTable is CreatedThis first step happens only once when an application first starts. The RouteTable maps URLs to handlers.2. Step 2 – The UrlRoutingModule Intercepts the RequestThis second step happens whenever you make a request. The UrlRoutingModule intercepts every request and creates and executes the right handler.3. Step 3 – The MvcHandler ExecutesThe MvcHandler creates a controller, passes the controller a ControllerContext, and executes the controller.4. Step 4 – The Controller ExecutesThe controller determines which controller method to execute, builds a list of parameters, and executes the method.5. Step 5 – The RenderView Method is CalledTypically, a controller method calls RenderView() to render content back to the browser. The Controller.RenderView() method delegates its work to a particular ViewEngine.Let’s examine each of th ese steps in detail.Step 1 : The RouteTable is CreatedWhen you request a page from a normal application, there is a page on disk that corresponds to each page request. For example, if you request a page named SomePage.aspx thenthere better be a page named SomePage.aspx sitting on your web server. If not, you receive an error.Technically, an page represents a class. And, not just any class. An page is a handler. In other words, an page implements the IHttpHandler interface and has a ProcessRequest() method that gets called when you request the page. The ProcessRequest() method is responsible for generating the content that gets sent back to the browser.So, the way that a normal application works is simple and intuitive. You request a page, the page request corresponds to a page on disk, the page executes its ProcessRequest() method and content gets sent back to the browser.An MVC application does not work like this. When you request a page from an MVC application, there is no page on disk that corresponds to the request. Instead, the request is routed to a special class called a controller. The controller is responsible for generating the content that gets sent back to the browser.When you write a normal application, you build a bunch of pages. There is always a one-to-one mapping between URLs and pages. Corresponding to each page request, there better be a page.When you build an MVC application, in contrast, you build a bunch of controllers. The advantage of using controllers is that you can have a many-to-one mapping between URLs and pages. For example, all of the following URLs can be mapped to the same controller:The single controller mapped to these URLs can display product information for the right product by extracting the product Id from the URL. The controller approach is more flexible than the classic approach. The controller approach also results in more readable and intuitive URLs.So, how does a particular page request get routed to a particular controller? An MVC application has something called a Route Table. The Route Table maps particular URLs to particular controllers.An application has one and only one Route Table. This Route Table is setup in the Global.asax file. Listing 1 contains the default Global.asax file that you get when you create a new MVC Web Application project by using Visual Studio.An application’s Route Table is represented by the static RouteTable.Routes property. This property represents a collection of Route objects. In the Global.asax file in Listing 1, two Route objects are added to the Route Table when the application first starts (The Application_Start() method is called only once when the very first page is requested from a website).A Route object is responsible for mapping URLs to handlers. In Listing 1, two Route objects are created. Both Route objects map URLs to the MvcRouteHandler. The first Route maps any URL that follows the pattern {controller}/{action}/{id} to the MvcRouteHandler. The second Route maps the particular URL Default.aspx to the MvcRouteHandler.By the way, this new routing infrastructure can be used independently of an MVC application. The Global.asax file maps URLs to the MvcRouteHandler. However, you have the option of routing URLs to a different type of handler. The routing infrastructure described in this section is contained in a distinct assembly named System.Web.Routing.dll. You can use the routing without using the MVC.Step 2 : The UrlRoutingModule Intercepts the RequestWhenever you make a request against an MVC application, the request is interceptedby the UrlRoutingModule HTTP Module. An HTTP Module is a special type of class that participates in each and every page request. For example, classic includes a FormsAuthenticationModule HTTP Module that is used to implement page access security using Forms Authentication.When the UrlRoutingModule intercepts a request, the first thing the module does is to wrap up the current HttpContext in an HttpContextWrapper2 object. The HttpContextWrapper2 class, unlike the normal HttpContext class, derives from the HttpContextBase class. Creating a wrapper for HttpContext makes it easier to mock the class when you are using a Mock Object Framework such as Typemock Isolator or Rhino Mocks.Next, the module passes the wrapped HttpContext to the RouteTable that was setup in the previous step. The HttpContext includes the URL, form parameters, query string parameters, and cookies associated with the current request. If a match can be made between the current request and one of the Route objects in the Route Table, then a RouteData object is returned.If the UrlRoutingModule successfully retrieves a RouteData object then the module next creates a RouteContext object that represents the current HttpContext and RouteData. The module then instantiates a new HttpHandler based on the RouteTable and passes the RouteContext to the new handler’s constructor.In the case of an MVC application, the handler returned from the RouteTable will always be an MvcHandler (The MvcRouteHandler returns an MvcHandler). Whenever the UrlRoutingModule can match the current request against a Route in the Route Table, an MvcHandler is instantiated with the current RouteContext.The last step that the module performs is setting the MvcHandler as the current HTTP Handler.An application calls the ProcessRequest() method automatically on the current HTTP Handler which leads us to the next step.Step 3 : The MvcHandler ExecutesIn the previous step, an MvcHandler that represents a particular RouteContext was set as the current HTTP Handler. An application always fires off a certain series of events including Start, BeginRequest, PostResolveRequestCache, PostMapRequestHandler, PreRequestHandlerExecute, and EndRequest events (there are a lot of application events – for a complete list, lookup the HttpApplication class in the Microsoft Visual Studio 2008 Documentation).Everything described in the previous section happens during the PostResolveRequestCache and PostMapRequestHandler events. The ProcessRequest() method is called on the current HTTP Handler right after the PreRequestHandlerExecute event.When ProcessRequest() is called on the MvcHandler object created in the previous section, a new controller is created. The controller is created from a ControllerFactory. This is an extensibility point since you can create your own ControllerFactory. The default ControllerFactory is named, appropriately enough, DefaultControllerFactory.The RequestContext and the name of the controller are passed to theControllerFactory.CreateController() method to get a particular controller. Next, a ControllerContext object is constructed from the RequestContext and the controller. Finally, the Execute() method is called on the controller class. The ControllerContext is passed to the Execute() method when the Execute() method is called.Step 4 : The Controller ExecutesThe Execute() method starts by creating the TempData object (called the Flash object in the Ruby on Rails world). The TempData can be used to store temporary data that must be used with the very next request (TempData is like Session State with no long-term memory).Next, the Execute() method builds a list of parameters from the request. These parameters, extracted from the request parameters, will act as method parameters. The parameters will be passed to whatever controller method gets executed.The Execute() method finds a method of the controller to execute by using reflection on the controller class (.NET reflection and not navel gazing reflection). The controller class is something that you wrote. So the Execute() method finds one of the methods that you wrote for your controller class and executes it. The Execute() method will not execute any controller methods that are decorated with the NonAction attribute.At this point in the lifecycle, we’ve entered your application code.Step 5 : The RenderView Method is CalledNormally, your controller methods end with a call to either the RenderView() or RedirectToAction() method. The RenderView() method is responsible for rendering a view (a page) to the browser.When you call a controller’s RenderView() method, the call is delegated to the current ViewEngine’s RenderView() method. The ViewEngine is another extensibility point. The default ViewEngine is the WebFormViewEngine. However, you can use another ViewEngine such as the NHaml ViewEngine.The WebFormViewEngine.RenderView() method uses a class named the ViewLocator class to find the view. Next, it uses a BuildManager to create an instance of a ViewPage class from its path. Next, if the page has a master page, the location of the master page is set (again, using the ViewLocator class). If the page has ViewData, the ViewData is set. Finally, the RenderView() method is called on the ViewPage.The ViewPage class derives from the base System.Web.UI.Page class. This is the same class that is used for pages in classic . The final action that RenderView() method performs is to call ProcessRequest() on the page class. Calling ProcessRequest() generates content from the view in the same way that content is generated from a normal page.Extensibility PointsThe MVC lifecycle was designed to include a number of extensibility points. These are points where you can customize the behavior of the framework by plugging in a custom class or overriding an existing class. Here’s a summary of these extensibility points:1. Route objects – When you build the Route Table, you call the RouteCollection.Add() method to add new Route objects. The Add() method accepts a RouteBase object. You can implement your own Route objects that inherit from the base RouteBase class.2. MvcRouteHandler – When building an MVC application, you map URLs to MvcRouteHandler objects. However, you can map a URL to any class that implements the IRouteHandler interface. The constructor for the Route class accepts any object that implements the IRouteHandler interface.3. MvcRouteHandler.GetHttpHandler() – The GetHttpHandler() method of the MvcRouteHandler class is a virtual method. By default, an MvcRouteHandler returns an MvcHandler. If you prefer, you can return a different handler by overriding the GetHttpHandler() method.4. ControllerFactory – You can assign a custom class by calling theSystem.Web.MVC.ControllerBuilder.Current.SetControllerFactory() method to create a custom controller factory. The controller factory is responsible for returning controllers for a given controller name and RequestContext.5. Controller – You can implement a custom controller by implementing the IController interface. This interface has a single method: Execute(ControllerContext controllerContext).6. ViewEngine – You can assign a custom ViewEngine to a controller. You assign a ViewEngine to a controller by assigning a ViewEngine to the public Controller.ViewEngine property. A ViewEngine must implement the IViewEngine interface which has a single method: RenderView(ViewContext viewContext).7. ViewLocator – The ViewLocator maps view names to the actual view files. You can assign a custom ViewLocator to the default WebFormViewEngine.ViewLocator property.If you can think of any other extensibility points that I overlooked, please add a comment to this blog post and I will update this entry.SummaryThe goal of this blog entry was to describe the entire life of an MVC request from birth to death. I examined the five steps involved in processing an MVC request: Creating the RouteTable, Intercepting the request with the UrlRoutingModule, Generating a Controller, Executing an Action, and Rendering a View. Finally, I talked about the points at which the MVC Framework can be extended.探究 MVC: MVC请求的生命周期本书详细描述了 MVC请求从开始到结束的整个过程,当你在浏览器上输入URL地址并且在网站请求页面敲击回车时,这个过程就产生了。
ASPNET是什么(计算机专业外文翻译)
外文文献原文What is ? is a programming framework built on the common language runtime that can be used on a server to build powerful Web applications. offers several important advantages over previous Web development models: Enhanced Performance. is compiled common language runtime code running on the server. Unlike its interpreted predecessors, can take advantage of early binding, just-in-time compilation, native optimization, and caching services right out of the box. This amounts to dramatically better performance before you ever write a line of code.World-Class Tool Support. The framework is complemented by a rich toolbox and designer in the Visual Studio integrated development environment. WYSIWYG editing, drag-and-drop server controls, and automatic deployment are just a few of the features this powerful tool provides.Power and Flexibility. Because is based on the common language runtime, the power and flexibility of that entire platform is available to Web application developers. The .NET Framework class library, Messaging, and Data Access solutions are all seamlessly accessible from the Web. is also language-independent, so you can choose the language that best applies to your application or partition your application across many languages. Further, common language runtime interoperability guarantees that your existing investment in COM-based development is preserved when migrating to .Simplicity. makes it easy to perform common tasks, from simple form submission and client authentication to deployment and site configuration. For example, the page framework allows you to build user interfaces that cleanly separate application logic from presentation code and to handle events in a simple, Visual Basic - like forms processing model. Additionally, the common language runtime simplifies development, with managed code services such as automatic reference counting and garbage collection.Manageability. employs a text-based, hierarchical configuration system, which simplifies applying settings to your server environment and Web applications. Because configuration information is stored as plain text, new settings may be applied without the aid of local administration tools. This "zero local administration" philosophy extends to deploying Framework applications as well. An Framework application is deployed to a server simply by copying the necessary files to the server. No server restart is required, even to deploy or replace running compiled code.Scalability and Availability. has been designed with scalability in mind, with features specifically tailored to improve performance in clustered and multiprocessor environments. Further, processes are closely monitored and managed by the runtime, so that if one misbehaves (leaks, deadlocks), a new process can be created in its place, which helps keep your application constantly available tohandle requests.Customizability and Extensibility. delivers a well-factored architecture that allows developers to "plug-in" their code at the appropriate level. In fact, it is possible to extend or replace any subcomponent of the runtime with your own custom-written component. Implementing custom authentication or state services has never been easier.Security. With built in Windows authentication and per-application configuration, you can be assured that your applications are secure.Data Binding Overview and Syntax introduces a new declarative data binding syntax. This extremely flexible syntax permits the developer to bind not only to data sources, but also to simple properties, collections, expressions, and even results returned from method calls. The following table shows some examples of the new syntax.Although this syntax looks similar to the ASP shortcut for Response.Write -- <%= %> -- its behavior is quite different. Whereas the ASP Response.Write shortcut syntax was evaluated when the page was processed, the data binding syntax is evaluated only when the DataBind method is invoked.DataBind is a method of the Page and all server controls. When you call DataBind on a parent control, it cascades to all of the children of the control. So, for example, DataList1.DataBind() invokes the DataBind method on each of the controls in the DataList templates. Calling DataBind on the Page -- Page.DataBind() or simply DataBind() -- causes all data binding expressions on the page to be evaluated. DataBind is commonly called from the Page_Load event, as shown in the following example.You can use a binding expression almost anywhere in the declarative section of an .aspx page, provided it evaluates to the expected data type at run time. The simple property, expression, and method examples above display text to the user when evaluated. In these cases, the data binding expression must evaluate to a value of type String. In the collection example, the data binding expression evaluates to a value of valid type for the DataSource property of ListBox. You might find it necessary to coerce the type of value in your binding expression to produce the desired result. For example, if count is an integer:Number of Records: <%# count.ToString() %>Binding to Simple PropertiesThe data binding syntax supports binding to public variables, properties of the Page, and properties of other controls on the page.The following example illustrates binding to a public variable and simple property on the page. Note that these values are initialized before DataBind() is called.The following example illustrates binding to a property of another control. Binding to Collections and ListsList server controls like DataGrid, ListBox and HTMLSelect use a collection as a data source. The following examples illustrate binding to usual common language runtime collection types. These controls can bind only to collections that support theIEnumerable, ICollection, or IListSource interface. Most commonly, you'll bind to ArrayList, Hashtable, DataView and DataReader.The following example illustrates binding to an ArrayList.The following example illustrates binding to a DataView. Note that the DataView class is defined in the System.Data namespace.The following example illustrates binding to a Hashtable.Binding Expressions or MethodsOften, you'll want to manipulate data before binding to your page or a control. The following example illustrates binding to an expression and the return value of a method.DataBinder.EvalThe framework supplies a static method that evaluates late-bound data binding expressions and optionally formats the result as a string. DataBinder.Eval is convenient in that it eliminates much of the explicit casting the developer must do to coerce values to the desired data type. It is particularly useful when data binding controls within a templated list, because often both the data row and the data field must be cast.Consider the following example, where an integer will be displayed as a currency string. With the standard data binding syntax, you must first cast the type of the data row in order to retrieve the data field, IntegerValue. Next, this is passed as an argument to the String.Format method.This syntax can be complex and difficult to remember. In contrast, DataBinder.Eval is simply a method with three arguments: the naming container for the data item, the data field name, and a format string. In a templated list like DataList, DataGrid, or Repeater, the naming container is always Container.DataItem. Page is another naming container that can be used with DataBinder.Eval.The format string argument is optional. If it is omitted, DataBinder.Eval returns a value of type object, as shown in the following example.It is important to note that DataBinder.Eval can carry a noticeable performance penalty over the standard data binding syntax because it uses late-bound reflection. Use DataBinder.Eval judiciously, especially when string formatting is not required.Section SummaryThe declarative data binding syntax uses the <%# %> notation.You can bind to data sources, properties of the page or another control, collections, expressions, and results returned from method calls.List controls can bind to collections that support the ICollection, IEnumerable, or IListSource interface, such as ArrayList, Hashtable, DataView, and DataReader.DataBinder.Eval is a static method for late binding. Its syntax can be simpler than the standard data binding syntax, but performance is slower.Section SummaryThe DataList and Repeater controls provide developers fine-tuned control over the rendering of data-bound lists.Rendering of bound data is controlled using a template, such as the HeaderTemplate, FooterTemplate, or ItemTemplate.The Repeater control is a general-purpose iterator, and does not insert anything in its rendering that is not contained in a template.The DataList control offers more control over the layout and style of items, and outputs its own rendering code for formatting.The DataList supports the Select, Edit/Update/Cancel, and Item Command events, which can be handled at the page level by wiring event handlers to the DataList's Command events.DataList supports a SelectedItemTemplate and EditItemTemplate for control over the rendering of a selected or editable item.Controls can be programmatically retrieved from a template using the Control.FindControl method. This should be called on a DataListItem retrieved from the DataList's Items collection.外文文献译文是什么?是一个能在规划好框架的服务器上建造强大的网络应用。
Asp net技术 毕业论文外文翻译
技术的前身ASP技术,是在IIS 2.0上首次推出(Windows NT 3.51),当时与 ADO 1.0 一起推出,在IIS 3.0 (Windows NT 4.0)发扬光大,成为服务器端应用程序的热门开发工具,微软还特别为它量身打造了Visual 标识InterDev开发工具,在1994年到2000年之间,ASP技术已经成为微软推展Windows NT 4.0平台的关键技术之一,数以万计的ASP网站也是这个时候开始如雨后春笋般的出现在网络上。
它的简单以及高度可定制化的能力,也是它能迅速崛起的原因之一。
不过ASP的缺点也逐渐的浮现出来:意大利面型的程序开发方法,让维护的难度提高很多,尤其是大型的ASP应用程序。
直译式的VBScript或JScript语言,让效能有些许的受限。
延展性因为其基础架构扩充性不足而受限,虽然有COM元件可用,但开发一些特殊功能(像文件上传)时,没有来自内置的支持,需要寻求第三方软件商开发的元件。
1997年时,微软开始针对ASP的缺点(尤其是意大利面型的程序开发方法)准备开始一个新项目来开发,当时的主要领导人Scott Guthrie刚从杜克大学毕业,他和IIS团队的Mark Anders经理一起合作两个月,开发出了下一代ASP 技术的原型,这个原型在1997年的圣诞节时被发展出来,并给予一个名称:XSP,这个原型产品使用的是Java语言。
不过它马上就被纳入当时还在开发中的CLR平台,Scott Guthrie事后也认为将这个技术移植到当时的CLR平台,确实有很大的风险(huge risk),但当时的XSP团队却是以CLR开发应用的第一个团队。
为了将XSP移植到CLR中,XSP团队将XSP的内核程序全部以C#语言重新撰写,并且改名为ASP+,作为ASP技术的后继者,并且也会提供一个简单的移转方法给ASP开发人员。
ASP+首次的Beta版本以及应用在PDC 2000中亮相,由Bill Gates 主讲Keynote(即关键技术的概览),由富士通公司展示使用COBOL语言撰写ASP+应用程序,并且宣布它可以使用Visual 、C#、Perl与Python语言(后两者由ActiveState公司开发的互通工具支持)来开发。
ASP NET 技术中英文对照外文翻译文献
中英文对照外文翻译文献(文档含英文原文和中文翻译)中英文资料对照外文翻译 Technique1. Building Pages and the .NET Framework is part of Microsoft's overall .NET framework, which contains a vast set of programming classes designed to satisfy any conceivable programming need. In the following two sections, you learn how fits within the .NET framework, and you learn about the languages you can use in your pages.The .NET Framework Class LibraryImagine that you are Microsoft. Imagine that you have to support multiple programming languages—such as Visual Basic, JScript, and C++. A great deal of the functionality of these programming languages overlaps. For example, for each language, you would have to include methods for accessing the file system, working with databases, and manipulating strings.Furthermore, these languages contain similar programming constructs. Every language, for example, can represent loops and conditionals. Even though the syntax of a conditional written in Visual Basic differs from the syntax of a conditional written in C++, the programming function is the same.Finally, most programming languages have similar variable data types. In most languages, you have some means of representing strings and integers, for example. The maximum and minimum size of an integer might depend on the language, but the basic data type is the same.Maintaining all this functionality for multiple languages requires a lot of work. Why keep reinventing the wheel? Wouldn't it be easier to create all this functionality once and use it for every language?The .NET Framework Class Library does exactly that. It consists of a vast set of classes designed to satisfy any conceivable programming need. For example, the .NET framework contains classes for handling database access, working with the file system, manipulating text, and generating graphics. In addition, it contains more specialized classes for performing tasks such as working with regular expressions and handling network protocols.The .NET framework, furthermore, contains classes that represent all the basic variable data types such as strings, integers, bytes, characters, and arrays.Most importantly, for purposes of this book, the .NET Framework Class Library contains classes for building pages. You need to understand, however, that you can access any of the .NET framework classes when you are building your pages.Understanding NamespacesAs you might guess, the .NET framework is huge. It contains thousands of classes (over 3,400). Fortunately, the classes are not simply jumbled together. The classes of the .NET framework are organized into a hierarchy of namespaces.ASP Classic NoteIn previous versions of Active Server Pages, you had access to only five standard classes (the Response, Request, Session, Application, and Server objects). , in contrast, provides you with access to over 3,400 classes!A namespace is a logical grouping of classes. For example, all the classes that relate to working with the file system are gathered together into the System.IO namespace.The namespaces are organized into a hierarchy (a logical tree). At the root of the tree is the System namespace. This namespace contains all the classes for the base data types, such as strings and arrays. It also contains classes for working with random numbers and dates and times.You can uniquely identify any class in the .NET framework by using the full namespace of the class. For example, to uniquely refer to the class that represents a file system file (the File class), you would use the following:System.IO.FileSystem.IO refers to the namespace, and File refers to the particular class.NOTEYou can view all the namespaces of the standard classes in the .NET Framework Class Library by viewing the Reference Documentation for the .NET Framework.Standard NamespacesThe classes contained in a select number of namespaces are available in your pages by default. (You must explicitly import other namespaces.) These default namespaces contain classes that you use most often in your applications:System— Contains all the base data types and other useful classes such as those related to generating random numbers and working with dates and times.System.Collections— Contains classes for working with standard collection types such as hash tables, and array lists.System.Collections.Specialized— Contains classes that represent specializedcollections such as linked lists and string collections.System.Configuration— Contains classes for working with configuration files(Web.config files).System.Text— Contains classes for encoding, decoding, and manipulating the contents of strings.System.Text.RegularExpressions— Contains classes for performing regular expression match and replace operations.System.Web— Contains the basic classes for working with the World Wide Web, including classes for representing browser requests and server responses.System.Web.Caching— Contains classes used for caching the content of pages and classes for performing custom caching operations.System.Web.Security— Contains classes for implementing authentication andauthorization such as Forms and Passport authentication.System.Web.SessionState— Contains classes for implementing session state.System.Web.UI— Contains the basic classes used in building the user interface of pages.System.Web.UI.HTMLControls— Contains the classes for the HTML controls.System.Web.UI.WebControls— Contains the classes for the Web controls..NET Framework-Compatible LanguagesFor purposes of this book, you will write the application logic for your pages using Visual Basic as your programming language. It is the default language for pages. Although you stick to Visual Basic in this book, you also need to understand that you can create pages by using any language that supports the .NET Common Language Runtime. Out of the box, this includes C#, , and the Managed Extensions to C++.NOTEThe CD included with this book contains C# versions of all the code samples.Dozens of other languages created by companies other than Microsoft have been developed to work with the .NET framework. Some examples of these other languages include Python, SmallTalk, Eiffel, and COBOL. This means that you could, if you really wanted to, write pages using COBOL.Regardless of the language that you use to develop your pages, you need to understand that pages are compiled before they are executed. This means that pages can execute very quickly.The first time you request an page, the page is compiled into a .NET class, and the resulting class file is saved beneath a special directory on your server named Temporary Files. For each and every page, a corresponding class file appears in the Temporary Files directory. Whenever you request the same page in the future, the corresponding class file is executed.When an page is compiled, it is not compiled directly into machine code. Instead, it is compiled into an intermediate-level language called Microsoft Intermediate Language (MSIL). All .NET-compatible languages are compiled into this intermediate language.An page isn't compiled into native machine code until it is actually requested by a browser. At that point, the class file contained in the Temporary Files directory is compiled with the .NET framework Just in Time (JIT) compiler and executed.The magical aspect of this whole process is that it happens automatically in the background. All you have to do is create a text file with the source code for your page, and the .NET framework handles all the hard work of converting it into compiled code for you.ASP CLASSIC NOTEWhat about VBScript? Before , VBScript was the most popular language for developing Active Server Pages. does not support VBScript, and this is good news. Visual Basic is a superset of VBScript, which means that Visual Basic has all the functionality of VBScript and more. So, you have a richer set of functions and statements with Visual Basic.Furthermore, unlike VBScript, Visual Basic is a compiled language. This means that if you use Visual Basic to rewrite the same code that you wrote with VBScript, you can get better performance.If you have worked only with VBScript and not Visual Basic in the past, don't worry. Since VBScript is so closely related to Visual Basic, you'll find it easy to make the transition between the two languages.NOTEMicrosoft includes an interesting tool named the IL Disassembler (ILDASM) withthe .NET framework. You can use this tool to view the disassembled code for any of the classes in the Temporary Files directory. It lists all the methods and properties of the class and enables you to view the intermediate-level code.This tool also works with all the controls discussed in this chapter. For example, you can use the IL Disassembler to view the intermediate-level code for the TextBox control (located in a file named System.Web.dll).Introducing Controls controls provide the dynamic and interactive portions of the user interface for your Web application. The controls render the content that the users of your Web site actually see and interact with. For example, you can use controls to create HTML form elements, interactive calendars, and rotating banner advertisements. controls coexist peacefully with HTML content. Typically, you create the static areas of your Web pages with normal HTML content and create the dynamic or interactive portions with controls.The best way to understand how controls work in an HTML page is to look at a simple Web Forms Page.Adding Application Logic to an PageThe second building block of an page is the application logic, which is the actual programming code in the page. You add application logic to a page to handle both control and page events.If a user clicks a Button control within an HTML form, for example, the Button control raises an event (the Click event). Typically, you want to add code to the page that does something in response to this event. For example, when someone clicks the Button control, you might want to save the form data to a file or database.Controls are not the only things that can raise events. An page itself raises several events every time it is requested. For example, whenever you request a page, the page's Load event is triggered. You can add application logic to the page that executes whenever the Load event occurs.2. Building Forms with Web Server ControlsBuilding Smart FormsYou use several of the basic Web controls to represent standard HTML form elements such as radio buttons, text boxes, and list boxes. You can use these controls in your pages to create the user interface for your Web application. The following sections provide detailed overviews and programming samples for each of these Web controls.Controlling Page NavigationIn the following sections, you learn how to control how a user moves from one page to another. First, you learn how to submit an HTML form to another page and retrieve form information. Next, you learn how to use the Redirect() method to automatically transfer a user to a new page. Finally, you learn how to link pages together with the HyperLink control.Applying Formatting to ControlsIn the following sections, you learn how to make more attractive Web forms. First, you look at an overview of the formatting properties common to all Web controls; they are the formatting properties of the base control class. Next, you learn how to apply Cascading Style Sheet styles and classes to Web controls.3. Performing Form Validation with Validation ControlsUsing Client-side ValidationTraditionally, Web developers have faced a tough choice when adding form validation logic to their pages. You can add form validation routines to your server-side code, or you can add the validation routines to your client-side code.The advantage of writing validation logic in client-side code is that you can provide instant feedback to your users. For example, if a user neglects to enter a value in a required formfield, you can instantly display an error message without requiring a roundtrip back to the server.People really like client-side validation. It looks great and creates a better overall user experience. The problem, however, is that it does not work with all browsers. Not all browsers support JavaScript, and different versions of browsers support different versions of JavaScript, so client-side validation is never guaranteed to work.For this reason, in the past, many developers decided to add all their form validation logic exclusively to server-side code. Because server-side code functions correctly with any browser, this course of action was safer.Fortunately, the Validation controls discussed in this chapter do not force you to make this difficult choice. The Validation controls automatically generate both client-side and server-side code. If a browser is capable of supporting JavaScript, client-side validation scripts are automatically sent to the browser. If a browser is incapable of supporting JavaScript, the validation routines are automatically implemented in server-side code.You should be warned, however, that client-side validation works only with Microsoft Internet Explorer version 4.0 and higher. In particular, the client-side scripts discussed in this chapter do not work with any version of Netscape Navigator.Requiring Fields: The RequiredFieldValidator ControlYou use RequiredFieldValidator in a Web form to check whether a control has a value. Typically, you use this control with a TextBox control. However, nothing is wrong with using RequiredFieldValidator with other input controls such as RadioButtonList. Validating Expressions: The RegularExpressionValidator ControlYou can use RegularExpressionValidator to match the value entered into a form field to a regular expression. You can use this control to check whether a user has entered, for example, a valid e-mail address, telephone number, or username or password. Samples of how to use a regular expression to perform all these validation tasks are provided in the following sections.Comparing Values: The CompareValidator ControlThe CompareValidator control performs comparisons between the data entered into a form field and another value. The other value can be a fixed value, such as a particular number, or a value entered into another control.Summarizing Errors: The ValidationSummary ControlImagine that you have a form with 50 form fields. If you use only the Validation controls discussed in the previous sections of this chapter to display errors, seeing an error message on the page might be difficult. For example, you might have to scroll down to the 48th form field to find the error message.Fortunately, Microsoft includes a ValidationSummary control with the Validation controls. You can use this control to summarize all the errors at the top of a page, or wherever else you want.4. Advanced Control ProgrammingWorking with View StateBy default, almost all controls retain the values of their properties between form posts. For example, if you assign text to a Label control and submit the form, when the page is rendered again, the contents of the Label control are preserved.The magic of view state is that it does not depend on any special server or browser properties. In particular, it does not depend on cookies, session variables, or application variables. View state is implemented with a hidden form field called VIEWSTATE that is automatically created in every Web Forms Page.When used wisely, view state can have a dramatic and positive effect on the performance of your Web site. For example, if you display database data in a control that has view state enabled, you do not have to return to the database each time the page is posted back to the server. You can automatically preserve the data within the page's view state between form posts.Displaying and Hiding ContentImagine that you are creating a form with an optional section. For example, imagine that you are creating an online tax form, and you want to display or hide a section that contains questions that apply only to married tax filers.Or, imagine that you want to add an additional help button to the tax form. You might want to hide or display detailed instructions for completing form questions depending on a user's preferences.Finally, imagine that you want to break the tax form into multiple pages so that a person views only one part of the tax form at a time.In the following sections, you learn about the properties that you can use to hide and display controls in a form. You learn how to use the Visible and Enabled properties with individual controls and groups of controls to hide and display page content.Using the Visible and Enabled PropertiesEvery control, including both HTML and Web controls, has a Visible property that determines whether the control is rendered. When a control's Visible property has the value False, the control is not displayed on the page; the control is not processed for eitherpre-rendering or rendering.Web controls (but not every HTML control) have an additional property named Enabled. When Enabled has the value False and you are using Internet Explorer version 4.0 or higher, the control appears ghosted and no longer functions. When used with other browsers, such as Netscape Navigator, the control might not appear ghosted, but it does not function.Disabling View StateIn certain circumstances, you might want to disable view state for an individual control or for an page as a whole. For example, you might have a control that contains a lot of data (imagine a RadioButtonList control with 1,000 options). You might not want to load the data into the hidden __VIEWSTATE form field if you are worried that the form data would significantly slow down the rendering of the page.Using Rich ControlsIn the following sections, you learn how to use three of the more feature-rich controls in the framework. You learn how to use the Calendar control to display interactive calendars, the AdRotator control to display rotating banner advertisements, and the HTMLInputFile control to accept file uploads.5 ConclusionThe advantages of using Struts to realize the website construction: It adopts JSPmarked mechanism to get the reusing codes and abstract codes. This method contributed to improve the reusability and flexibility of codes. When the technology space or the problem space varied, users have much more chances to reuse codes. Using open source, everybody in the user’s ro om could check up codes. Struts make the designers and developers pay their attention to their own favorite aspects. Adopting separately control ideology to manage the problem space. The websites based on this pattern had perfectly robustness. The layer structures were clear. As to huge scale of system, Struts conducted to manage complicated system. The disadvantages of using Struts to realize the website construction: The applicable scope of Struts is limited. Struts are MVC solution based on web. So it must be achieved by HTML, JSP document and Servlet and use J2EE application program to support Struts. Struts need to support JSP1.1 and Servlet 2.2 standard Servlet container. Of course, isolating the problem scope, but strengthening the complicacy, so one must accept some training before they adopt Struts development.References1. Selfa, D.M., Carrillo, M., Del Rocío Boone, M.: A database and web application based onMVC architecture. In: International Conference on Electronics, Communications and Computers, pp. 48–49 (2006)2. Lin, Y.-L., Hu, J.-P.: Design and implementation of the internet service platform for rural house building technique criteria and management based on .NET MVC. Applied Mechanics and Materials, 1727–1731 (2011)3. Wang, L.-H., Xi, M., Li, D.-X.: A network-friendly architecture for Multi-view VideoCoding (MVC). Advanced Materials Research, 678–681 (2010)4. Li, J.-M., Ma, G.-S., Feng, G., Ma, Y.-Q.: Research on Web Application of Struts Framework Based on MVC Pattern. In: Shen, H.T., Li, J., Li, M., Ni, J., Wang, W. (eds.) APWeb Workshops 2006. LNCS, vol. 3842, pp. 1029–1032. Springer, Heidelberg (2006) 技术摘要:页面的构建,验证以及编程。
ASP论文外文翻译---从底层了解ASPNET的结构
原文1A low-level Look at the ArchitectureAbstract is a powerful platform for building Web applications that provides a tremendous amount of flexibility and power for building just about any kind of Web application. Most people are familiar only with the high level frameworks like WebForms and WebServices which sit at the very top level of the hierarchy. In this article I’ll describe the lower level aspects of and explain how requests move from Web Server to the runtime and then through the Http Pipeline to process requests.What is Let’s start with a simple definition: What is ? I like to define as follows: is a sophisticated engine using Managed Code for front to back processing of Web Requests.It's much more than just WebForms and Web Services… is a request processing engine. It takes an incoming request and passes it through its internal pipeline to an end point where you as a developer can attach code to process that request. This engine is actually completely separated from HTTP or the Web Server. In fact, the HTTP Runtime is a component that you can host in your own applications outside of IIS or any server side application altogether. The runtime provides a complex yet very elegant mechanism for routing requests through this pipeline. There are a number of interrelated objects, most of which are extensible either via subclassing or through event interfaces at almost every level of the process, so the framework is hig hly extensible. Through this mechanism it’s possible to hook into very low level interfaces such as the caching, authentication and authorization. You can even filter content by pre or post processing requests or simply route incoming requests that match a specific signature directly to your code or another URL. There are a lot of different ways to accomplish the same thing, but all of the approaches are straightforward to implement, yet provide flexibility in finding the best match for performance and ease of development.The entire engine was completely built in managed code and all of the extensibility functionality is provided via managed code extensions. This is a testament to the power of the .NET framework in its ability to build sophisticated and very performance oriented architectures. Above all though, the most impressive part of is the thoughtful design that makes the architecture easy to work with, yet provides hooks into just about any part of the request processing.With you can perform tasks that previously were the domain of ISAPI extensions and filters on IIS –with some limitations, but it’s a lot closer than say ASP was. ISAPI is a low level Win32 style API that had a very meager interface and was very difficult to work for sophisticated applications. Since ISAPI is very low level it also is very fast, but fairly unmanageable for application level development. So, ISAPI has been mainly relegated for some time to providing bridge interfaces to other application or platf orms. But ISAPI isn’t dead by any means. In fact, on Microsoft platforms interfaces with IIS through an ISAPI extension that hosts .NET and through it the runtime. ISAPI provides the core interface from the Web Server and uses the unmanaged ISAPI code to retrieve input and send output back to the client. The content that ISAPI provides is available via common objects like HttpRequest and HttpResponse that expose the unmanaged data as managed objects with a nice and accessible interface.The ISAPI ConnectionISAPI is a low level unmanged Win32 API. The interfaces defined by the ISAPI spec are very simplistic and optimized for performance. They are very low level –dealing with raw pointers and function pointer tables for callbacks - but they provide he lowest and most performance oriented interface that developers and tool vendors can use to hook into IIS. Because ISAPI is very low level it’s not well suited for building application level code, and ISAPI tends to be used primarily as a bridge interface to provide Application Server type functionality to higher level tools. For example, ASP and both are layered on top of ISAPI as is Cold Fusion, most Perl, PHP and JSP implementations running on IIS as well as many third party solutions such as my own Web Connection framework for Visual FoxPro. ISAPI is an excellent tool to provide the high performance plumbing interface to higher level applications, which can then abstract the information that ISAPI provides. In ASP and , the engines abstract the information provided by the ISAPI interface in the form of objects like Request and Response that read their content out of the ISAPI request information. Think of ISAPI as the plumbing. For the ISAPI dll is very lean and acts merely as a routing mechanism to pipe the inbound request into the runtime. All the heavy lifting and processing, and even the request thread management happens inside of the engine and your code.As a protocol ISAPI supports both ISAPI extensions and ISAPI Filters. Extensions are a request handling interface and provide the logic to handle input and output with the Web Server –it’s essentially a transaction interface. ASP and are implemented as ISAPI extensions. ISAPI filters are hook interfaces that allow the ability to look at EVERY request that comes into IIS and to modify the content or change the behavior of functionalities like Authentication. Incidentally maps ISAPI-like functionality via two concepts: Http Handlers (extensions) and Http Modules (filters). We’ll look at these later in more detail.ISAPI is the initial code point that marks the beginning of an request. maps various extensions to its ISAPI extension which lives in the .NET Framework directory:本文摘自/presentations/howaspnetworks/howaspnetworks.asp译文1从底层了解的结构·摘要是一个用于构建Web程序的强大平台,提供了强大的柔性和能力以至于它可以构建任意的Web程序。
aspnet外文翻译--常见的ASPNET代码技术
外文翻译译文:常见的代码技术:技巧,教程,代码——Scott Mitchell利用集合大多数现代编程语言提供支持某种类型的对象,可以容纳一个可变数目的元素。
这些对象被称为集合,他们可以轻易地添加和删除元素,而不必担心适当的内存分配。
如果你使用经典ASP编程之前,你就可能已经熟悉了脚本,字典对象,采集对象的每个元素包含一个参考文本的关键。
这种方式存储对象的集合被称为一个哈希表。
有许多类型的集合,除了哈希表。
每一种类型的集合是相似的目的:它作为一种手段来存储不同数量的元素,提供一种简单的方法,在最小程度上添加和删除元素。
每一个不同类型的集合是唯一的方法储存、检索并借鉴它的各种因素,而.NET框架提供了很多的集合类型为开发人员使用。
事实上,整个的命名空间系统集合是专门从事集合类型和辅助课程。
这些类型的集合都可以存储对象类型的元素。
因为在.NET中所有的原始数据类型的字符串,整数,日期/时间,阵列,都是从目标类派生的,这些集合可以从字面上存储任何东西。
例如,你可以使用一个单一的收集,存储一个整数,一个典型的COM组件,字符串,日期/时间,和自定义编写的.NET组件的两个实例,一个实例的组合。
大多数的例子在本节中使用集合来容纳原始数据类型(字符串,整数,双打)。
然而,集合表明集合类型存储为它的每个元素的整个集合。
在本节中,我们将研究5个集合的.NET框架为开发人员提供数组列表,哈希表,可排序列表,队列,堆栈。
当你学习这些集合时,就会意识到他们有许多相似之处。
例如,每一个类型的集合可以通过元素与元素的迭代使用每个在VB中的下一个循环(或在C#中的每一个循环)。
每个集合类型都有一定数量的同样的函数名执行同样的任务。
例如,每个集合类型都有一个明确的方法,从集合中移除所有元素集和属性来返回集合中的元素的数量。
事实上,过去的”相似性的集合类型”的共同特点就是来考察所发现的集合类型。
使用数组列表第一种收集我们要看的是数组列表。
ASP[1].net外文翻译
外文文献译文是什么?是一个能在规划好框架的服务器上建造强大的网络应用。
提供几个重要的优于以前的网络发展模型之处:"增强的性能。
能在服务器上编译普通语言运行环境不象它的解释前人能利用早的结合、just-in-time编辑,本国的最佳化,贮藏箱的全然的服务。
Unlike its interpreted predecessors, can take advantage of early binding, just-in-time compilation, native optimization, and caching services right out of the box.这数量对戏剧性地较好的性能在你曾写一排密码之前。
"世界第一流水平的工具支持。
的骨架在在视力的电影制片厂整体的发展环境方面的个有钱的工具箱和设计者旁是与补体连结的。
所见即所得编辑、drag-and-drop服务员控制和自动的使用是刚才一特征很少这个强大的工具提供。
"力和柔性。
因为运行时间以普通的语言为基础,完全的台是对网应用启发者有用的力和柔性。
净的骨架类图书馆,通知,数据通道解法从网全部是无缝地可以接近的。
也是语言独立的,因此你能选择语言最好地适用于你的应用或横过许多语言瓜分你的应用。
更多地,普通的语言运行时间相互操作性保证你的现存的对根据COM发展的投资当到移时保存。
"简单性。
使从对使用和地点外形的简单的形式屈服于和顾客证实做普通的任务是容易的。
例如,的页骨架允许你建造使用者界面从表演密码的干净分离的应用逻辑并触摸事件在一简单的,可视化Basic如同形式处理模型。
另外,普通的语言运行时间简化发展,同管理密码服务像自动的提及计算和垃圾收集。
"可管理性。
雇用一个根据正文、hierarchical外形系统,这简化应用对你的服务员环境和网应用安置。
因为外形消息是作为清楚的正文贮藏,新的安置可能没有地方的管理工具的帮助被适用。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
Extreme 1.1Web Deployment ProjectsWhen ASP was first released, Web programming was more difficult because you needed IIS to serve your ASP pages. Later, 2.0 and Visual Studio® 2005 made everything easier by introducing the Web site model of development. Instead of creating a new project inside Visual Studio, the Web site model lets you point to a directory and start writing pages and code. Furthermore, you can quickly test your site with the built-in Development Server, which hosts in a local process and obviates the need to install IIS to begin developing. The beauty of the Web site model is that you can develop your Web application without thinking about packaging and deployment. Need another class? Add a .cs file to the App_Code directory and start writing. Want to store localizable strings in a resource file? Add a .resx file to the App_GlobalResources directory and type in the strings. Everything just works; you don't have to think about the compilation and deployment aspect at all.When you are ready to deploy, you have several options. The simplest choice is to copy your files to a live server and let everything be compiled on-demand (as it was in your test environment). The second option is to use the aspnet_compiler.exe utility and precompile the application into a binary release, which leaves you nothing but a collection of assemblies, static content, and configuration files to push to the server. The third option is to again use aspnet_compiler.exe, but to create an updateable binary deployment where your .as*x files remain intact (and modifiable) and all of your code files are compiled into binary assemblies.This seems to cover every possible scenario, leaving the developer to focus simply on writing the Web application, with packaging and deployment decisions to be made later when the application is actually deployed. There was a fair amount of backlash against this model, however, especially from developers who were used to their Web projects being real projects, specified in real project files, that let you inject pre-and post-build functions, exclude files from the build process, move between debug and release builds with a command-line switch, and so on. In response, Microsoft quickly introduced the Web Application Project or WAP, initially released as an add-in to Visual Studio 2005, and now included in Visual Studio 2005 Service available for download from /vstudio/support/vs2005sp1.WAP provides an alternative to the Web site model that is much closer to the Visual Studio .NET 2005 Web Project model. The new WAP model compiles all of the source code files during the build process and generates a single assembly in the local /bin directory for deployment. WAP also makes it much easier to incrementally adopt the new partial class codebehind modelintroduced in 2.0 because you can now open a Visual Studio .NET 2003 project and only your .sln and .csproj (or .vbproj) files will be modified during the conversion. You can then convert each file and its codebehind class to the new partial class model independently of any other file in the project (by right-clicking on the file in the Solution Explorer and selecting Convert to Web Application), or just leave them using the old model. This is in contrast to converting a Visual Studio .NET 2003 Web project to the Web site model, which converts all files at once and does not support incremental adoption.Finally, there is a new project type called Web Deployment Projects (the main topic of this column), which introduces myriad additional deployment options for both Web site projects and Web Application Projects. Web Deployment Projects fill the remaining holes in the deployment options for both Web site apps and Web Application Projects and make it possible to implement practically any deployment scenario in a simple and extensible way. To understand exactly what this new project type adds, let's first review what we had before Web Deployment Projects were available.When you build an application using the Web site model, you have the option of precompiling the site for deployment. You can access the precompilation utility through the Build | Publish menu in Visual Studio 2005 or directly through the command-line utility aspnet_compiler.exe. Figure 1 shows the interface to this tool exposed by Visual Studio.The first decision you have to make when using the publish utility is whether you want your .as*x files to be updatable once deployed (use the "Allow this precompiled site to be updatable" option of -u switch in the aspnet_compiler.exe command-line utility). This decision hinges on whether you want to be able to make minor changes to your pages once deployed without having to go through the entire deployment process again. You may, in fact, want to explicitly disallow any modifications to the deployed pages and require that all modifications go through the standard deployment (and hopefully testing) process, in which case publishing the site as not updatable is the proper choice.When a site is published as not updatable, it is possible to completely remove all .as*x files and publish only binary assemblies (plus configuration files and static content). However, without the physical files in place, it is impossible for to tell which classes to use for which endpoint requests. For example, if a request comes into your application for Page1.aspx and you have used non-updatable binary deployment, there very well may not be any Page1.aspx file on disk, and there is nothing in the existing configuration files to indicate which class in the collection of assemblies deployed to the /bin directory should actually be the handler for this request. To remedy this, the compilation process will also generate a collection of .compiled filesthat contain endpoint-to-type mapping and file dependency information in a simple XML format, and these files must be published along with the binary assemblies in the /bin directory of the deployed site. As an example, if you did have a page named Page1.aspx in your application, the aspnet_compiler.exe utility would generate a file named piled (with the hash code varying) that contained the following XML:<?xml version="1.0" encoding="utf-8"?><preserve resultType="3"virtualPath="/SampleWebSite/Page1.aspx"hash="8a8da6c5a" filehash="42c4a74221152888"flags="110000" assembly="App_Web_aq9bt8mj"type="ASP.page1_aspx"><filedeps><filedep name="/SampleWebSite/Page1.aspx" /><filedep name="/SampleWebSite/Page1.aspx.cs" /></filedeps></preserve>The other major decision you have to make when publishing a Web site with this utility is the granularity of the packaging of the generated assemblies. You can either create a separate assembly for each directory in your site or create a separate assembly for each compilable file in your site (.aspx, .ascx, .asax, and so on.) by checking the Use fixed naming and single page assemblies (or -fixednames in the aspnet_compiler.exe command-line utility). This decision is not as obvious as you might think, as each option has its own potential issues. If you elect to not use the -fixednames option, then every time you publish your application a completely new set of assemblies will be generated, with completely different names from the ones published earlier. This means that deployment is trickier because you must take care to delete all of the previously published assemblies on the live server before deploying the new assemblies or you'll generate redundant class definition errors on the next request. Using the -fixednames option will resolve this problem as each file will correspond to a distinctly named assembly that will not change from one compilation to the next. If you have a large site, however, generating a separate assembly for each page, control, and Master Page can easily mean managing the publication of hundreds of assemblies. It is this problem of assembly granularity in deployment that Web Deployment Projects solve in a much more satisfying way, as you will see.You can also introduce assembly signing into the compilation process to create strong-named, versioned assemblies, suitable for deployment in the Global Assembly Cache(GAC) if needed. You can mark the generated assemblies with the assembly-level attribute AllowPartiallyTrustedCallers using the -aptca option, which would be necessary if you did deploy any assemblies to the GAC and were running at a low or medium level of trust. (Keep in mind that this attribute should only be applied to assemblies that have been shown not to expose any security vulnerabilities, as using it with a vulnerability could expose a luring attack.) One other detail about publishing your site is that if you do elect to use Web Application Projects instead of the Web site model, the Build | Publish dialog box will look quite different, as shown in Figure 2. Web Application Projects assume that you want to publish the application as updatable .as*x files and precompiled source files (the same model it uses in development), so the binary-only deployment options are not available. This utility is really closer in nature to the Copy Web site utility available with Web sites than it is to the Publish Web Site utility since it involves copying files produced by the standard build process.Technically you are not restricted from using binary-only (non-updatable) deployment, even if you are using Web Application Projects. If you think about it, the output of the build of a WAP is a valid Web site, which you can then pass through the aspnet_compiler.exe utility to generate create a binary deployment. You just can't invoke it from the Visual Studio 2005 interface which, fortunately, Web Deployment Projects rectify.So what's missing from the existing compilation and deployment options presented so far? Primarily two things: the ability to control the naming of assemblies, especially for deployment purposes, and the ability to consolidate all of the output assemblies into a single assembly for simplified deployment. Web Deployment Projects solve both of these problems. Perhaps even more significantly, however, they also tie up a lot of loose ends in the deployment story that existed with Web site applications and Web Application Projects.At their core, Web Deployment Projects (available for download at /aa336619.aspx) represent just another type of project you add to your solution. Like all Visual Studio project files, Web deployment projects are MSBuild scripts that can be compiled directly in the IDE or run from the command line. Instead of specifying a collection of source code files to compile, however, Web Deployment Projects contain build commands to compile and package Web sites (or Web Application Projects). This means that they will invoke the aspnet_compiler.exe utility (among others) to create a deployment of a particular Web application. Web Deployment Projects are shipped as a Visual Studio add-in package that includes an easy-to-use menu item for injecting new projects and a complete set of property pages to control all of the available settings. To add one to an existing application, right-click on an existing Web site (or Web Application Project) and select the Add Web Deployment Project itemas shown in Figure 3. This will add a new .wdproj file containing an MSBuild script to your solution, which will generate a deployment of the application you created it from.Once the Web Deployment Project is part of your solution, you can access the property pages of the project file to control exactly what the project does for you, as shown in Figure 4. The default setting for a new deployment project is to deploy the application in updatable mode, with all the .as*x files intact, and the source files compiled into a single assembly deployed in the top-level /bin directory. These deployment projects work the same regardless of whether the source application is using the Web site model or the Web Application Project model, which means that you can now select either development model without impacting your deployment options. One of the most significant features of Web Deployment Projects is the ability to configure the deployment to be all binary (not updatable) in the form of a single assembly, the name of which you can choose. Using this model of deployment means that you can update your entire site merely by pushing a single assembly to the /bin directory of your live site, and not concern yourself with deleting existing assemblies prior to deploying or dealing with a partially deployed site causing errors. It is still necessary to deploy the .compiled files for the endpoint mappings, but these files only change when you add, delete, or move pages in your site.Web Deployment Projects provide flexibility in deployment and let you make packaging and deployment decisions independently of how you actually built your Web applications. This independence between development and deployment was partially achieved in the original release of 2.0 with the aspnet_compiler.exe utility, but never fully realized because of the constraints imposed when performing the deployment. With Web Deployment Projects, the separation between development and deployment is now complete, and your decision about how to build your applications will no longer impact your deployment choices.Merging AssembliesMuch of what Web Deployment Projects provide is just a repackaging of existing utilities exposed via MSBuild tasks and a new interface, but there are also a couple of completely new features included. The most intriguing is the ability to merge assemblies.When you install Web Deployment Projects, you will find an executable called aspnet_merge.exe in the installation directory. This executable is capable of taking the multi-assembly output of a precompiled site and merging the assemblies into one. This is the utility that is incorporated into your build script if you select the merge option in a Web Deployment Project. As an example of what is possible with this utility, consider the output of a precompiled Web site, run without the updatable switch, shown in Figure 5. The source application for this output contained two subdirectories, a top-level global.asax file, a classdefined in App_Code, and a user control. The end result of the compilation is five different assemblies and a collection of .compiled files. If you run the aspnet_merge.exe utility on this directory with the -o switch to request a single assembly output, shown at the bottom of Figure 5, the result is a much more manageable single assembly named whatever you specify.Although the aspnet_merge.exe utility and the corresponding MSBuild task that ship with Web Deployment Projects are new, the underlying technology for merging assemblies has actually been around since the Microsoft® .NET Framework 1.1 in the form of a utility made available from Microsoft Research called ILMerge, the latest version of which is available for download from /~mbarnett/ILMerge.aspx. This utility is directly incorporated into aspnet_merge.exe and does all the heavy lifting involved with merging assemblies. If you think about it, the merging of assemblies is a rather complicated task. You need to take into consideration signing, versioning, and other assembly-level attributes, embedded resources, and XML documentation, as well as manage the details of clashing type names, and so on. The ILMerge utility manages all of these details for you, with switches to control various decisions about the process. It also gives you the ability to transform .exe assemblies into .dll assemblies for packaging purposes. As an example, suppose you have three assemblies: a.dll, b.dll, and c.exe which you would like to merge into a single library assembly. As long as there were no conflicts in typenames, the following command line would generate a new library, d.dll with all of the types defined in a.dll, b.dll, and c.exe:ilmerge.exe /t:library /ndebug /out:d.dll a.dll b.dll c.exePluggable Configuration FilesThe other completely new feature that comes with Web Deployment Projects is the ability to create pluggable configuration files. It is a common problem when deploying Web applications to find a way to manage the differences in your configuration files between development and deployment. For example, you may have a local test database to run your site, have another database used by a staging server, and yet another used by the live server. If you are storing your connection strings in web.config (typically in the connectionStrings section), then you need some way of modifying those strings when the application is pushed out to a staging server or to a production machine. Web Deployment Projects offer a clean solution to this problem with a new MSBuild task called ReplaceConfigSections.This task allows you to specify independent files that store the contents of a particular configuration section independently based on solution configurations. For example, you might create a debugconnectionstrings.config file to store the debug version of our connectionStrings configuration section that looked like this:<connectionStrings><add connectionString="server=localhost;database=sales;trusted_connection=yes" name="sales_dsn"/> </connectionStrings>Similarly, you would then create separate files for each of the solution configurations defined (release, stage, and so on) and populate them with the desired connection strings for their respective deployment environments. For the release configuration, you might name the file releaseconnectionstrings.config and populate it as follows:<connectionStrings><add connectionString="server=livedbserver;database=sales;trusted_connection=yes"name="sales_dsn"/></connectionStrings>Next, you would configure the MSBuild script added by Web Deployment Projects to describe which configuration sections in the main web.config file should be replaced, and the source files that will supply the content for the replacement. You could modify the script by hand, but there is a nice interface exposed through the property pages of the build script in Visual Studio that will do it for you, as Figure 6 shows. In this case, you are setting the properties for the debug solution configuration, so check the Enable Web.config file section replacement option and specify the section to be replaced along with the file with the contents to replace it: You would use this same dialog page to set the configuration replacement for the Release solution configuration (and any others we had defined) with the corresponding files.When you then run the build script, the ReplaceConfigSections task extracts the contents from any associated config files and replaces the contents of the corresponding configuration section, creating a new web.config file that is pushed to the deployment directory. This configuration file replacement feature means that you can maintain configuration differences between deployment environments in a manageable way with text files that can be versioned under source control, and you don't have to resort to referring to that sticky note reminding you to change the connection string when you deploy. It should be emphasized that this feature works with any section of the configuration file, even custom sections, so if you have differences in other configuration sections (for example, appSettings) you can easily specify those differences with this build task as well.Creating Reusable User ControlsThere is an interesting side application of Web deployment projects that solves a problem that has plagued developers for years-how to create reusable user controls to share across applications. User controls are fundamentally just composite custom controls whose child controls are laid out in an .ascx file. The ability to use the designer for laying out controls and adding handlers is a huge benefit for most developers since it feels almost identical to building a page, except that the resulting .ascx file can be included as a control in any page. The disadvantage has always been that you need the physical .ascx file in the application's directory to actually use it. Techniques for making .ascx controls shareable across applications are available, but they usually involve chores like creating shared virtual directories between applications or harvesting temporary assemblies generated by at request time, and they've never been satisfactory.The introduction of the aspnet_compiler.exe utility in version 2.0 brought us much closer to a decent solution. With the compiler, you can create a Web site consisting of only user controls and publish the site in non-updateable mode using the compiler to generate reusable assemblies. Once you have the resulting assembly (or assemblies), you can then deploy to any Web application and reference the user control just as you would a custom control (not by using the src attribute as you would for .ascx files). The only disadvantage to this technique is that you either have to accept the randomly named assembly produced by the compilation process or select the fixednames option in the compiler to generate a fixed named assembly for each Master Page in the site (not a single assembly for the entire collection).Web Deployment Projects provide the final step to create truly reusable user control assemblies. You can take the same Web site consisting exclusively of user controls and add a Web Deployment Project to create a single output assembly with the name of your choice. It's even straightforward to create a signed assembly to deploy to the GAC for sharing controls across multiple applications without redeploying the assembly in each /bin directory.ConclusionThe release of Web Deployment Projects completes the set of tools for deploying applications in a very satisfying way. It is now possible to deploy your applications in any manner ranging from all source to all binary, with complete control over the generation, packaging, and naming of the binary assemblies. In addition, Web Deployment Projects provide a solution for replacing sections of your configuration files based on your target build, and they solve the problem of distributing reusable user controls. Anyone who is building and deploying applications will undoubtedly find some aspect of Web Deployment Projects compelling enough to begin using them today.2.1 Client-Side Web Service Calls with AJAX ExtensionsSince its inception, has fundamentally been a server-side technology. There were certainly places where would generate client-side JavaScript, most notably in the validation controls and more recently with the Web Part infrastructure, but it was rarely more than a simple translation of server-side properties into client-side behavior-you as the developer didn't have to think about interacting with the client until you received the next POST request. Developers needing to build more interactive pages with client-side JavaScript and DHTML were left to do it on their own, with some help from the 2.0 script callbacks feature. This has changed completely in the last year.At the Microsoft Professional Developer's Conference in September 2005, Microsoft unveiled a new add-on to , code-named "Atlas," which was focused entirely on leveraging client-side JavaScript, DHTML, and the XMLHttpRequest object. The goal was to aid developers in creating more interactive AJAX-enabled Web applications. This framework, which has since been renamed with the official titles of Microsoft® AJAX Library and the 2.0 AJAX Extensions, provides a number of compelling features ranging from client-side data binding to DHTML animations and behaviors to sophisticated interception of client POST backs using an UpdatePanel. Underlying many of these features is the ability to retrieve data from the server asynchronously in a form that is easy to parse and interact with from client-side JavaScript calls. The topic for this month's column is this new and incredibly useful ability to call server-side Web services from client-side JavaScript in an 2.0 AJAX Extensions-enabled page.Calling Web Services with AJAXIf you have ever consumed a Web service in the Microsoft .NET Framework, either by creating a proxy using the wsel.exe utility or by using the Add Web Reference feature of Visual Studio®, you are accustomed to working with .NET types to call Web services. In fact, invoking a Web service method through a .NET proxy is exactly like calling methods on any other class. The proxy takes care of preparing the XML based on the parameters you pass, and it carefully translates the XML response it receives into the .NET type specified by the proxy method. The ease with which developers can use the .NET Framework to consume Web service endpoints is incredibly enabling, and is one of the pillars that make service-oriented applications feasible today.The 2.0 AJAX Extensions enable this exact same experience of seamless proxy generation for Web services for client-side JavaScript that will run in the browser. You can author an .asmx file hosted on your server and make calls to methods on that service through a client-side JavaScript class. For example, Figure 1 shows a simple .asmx service that implements a faux stock quote retrieval (with random data).In addition to the standard .asmx Web service attributes, this service is adorned with the ScriptService attribute that makes it available to JavaScript clients as well. If this .asmx file is deployed in an AJAX-Enabled Web application, you can invoke methods of the service from JavaScript by adding a ServiceReference to the ScriptManager control in your .aspx file (this control is added automatically to your default.aspx page when you create a Web site in Visual Studio using the AJAX-enabled Web site template):<asp:ScriptManager ID="_scriptManager" runat="server"><Services><asp:ServiceReference Path="StockQuoteService.asmx" /></Services></asp:ScriptManager>Now from any client-side JavaScript routine, you can use the MsdnMagazine.StockQuoteService class to call any methods on the service. Because the underlying mechanism for invocation is intrinsically asynchronous, there are no synchronous methods available. Instead, each proxy method takes one extra parameter (beyond the standard input parameters)- a reference to another client-side JavaScript function that will be called asynchronously when the method completes. The example page shown in Figure 2 uses client-side JavaScript to print the result of calling the stock quote Web service to a label (span) on the page.If something goes wrong with a client-side Web service call, you definitely want to let the client know, so it's usually wise to pass in another method that can be invoked if an error, abort, or timeout occurs. For example, you might change the OnLookup method shown previously as follows, and add an additional OnError method to display any problems:function OnLookup(){var stb = document.getElementById("_symbolTextBox");MsdnMagazine.StockQuoteService.GetStockQuote(stb.value, OnLookupComplete, OnError);}function OnError(result){alert("Error: " + result.get_message());}This way if the Web service call fails, you will notify the client with an alert box. You can also include a userContext parameter with any Web service calls made from the client, which is an arbitrary string passed in as the last parameter to the Web method, and it will be propagated to both the success and failure methods as an additional parameter. In this case, it might make sense to pass the actual symbol of the stock requested as the userContext so you can display it in the OnLookupComplete method:function OnLookup(){var stb = document.getElementById("_symbolTextBox");MsdnMagazine.StockQuoteService.GetStockQuote(stb.value, OnLookupComplete, OnError, stb.value);}function OnLookupComplete(result, userContext){// userContext contains symbol passed into methodvar res = document.getElementById("_resultLabel");res.innerHTML = userContext + " : <b>" + result + "</b>";}If you find that you're making many different calls to a Web service, and that you re-use the same error and/or complete methods for each call, you can also set the default error and succeeded callback method globally. This avoids having to specify the pair of callback methods each time you make a call (although you can choose to override the globally defined methods on a per-method basis). Here is a sample of the OnLookup method that sets the default succeeded and failed callback methods globally instead of on a per-call basis.// Set default callbacks for stock quote serviceMsdnMagazine.StockQuoteService.set_defaultSucceededCallback(OnLookupComplete);MsdnMagazine.StockQuoteService.set_defaultFailedCallback(OnError);function OnLookup(){MsdnMagazine.StockQuoteService.GetStockQuote(stb.value);}。