外文翻译aspnet概述
计算机专业ASPNET外文翻译
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);}。
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概述ASP.NETOverview
英文文献及中文翻译 Overview is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of 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 and C#. These languages enable you to develop applications that benefit from the common language runtime, type safety, inheritance, and so on.If you want to try , you can install Visual Web Developer Express using the Microsoft Web Platform Installer, which is a free tool that makes it simple to download, install, and service components of the Microsoft Web Platform.These components include Visual Web Developer Express, Internet Information Services (IIS), SQL Server Express, and the .NET Framework. All of these are tools that you use to create Web applications. You can also use the Microsoft Web Platform Installer to install open-source and PHP Web applications.Visual Web DeveloperVisual Web Developer is a full-featured development environment for creating Web applications. Visual Web Developer provides an ideal environment in which to build Web sites and then publish them to a hosting site. Using the development tools in Visual Web Developer, you can develop Web pages on your own computer. Visual Web Developer includes a local Web server that provides all the features you need to test and debug Web pages, without requiring Internet Information Services (IIS) to be installed.Visual Web Developer provides an ideal environment in which to build Web sitesand then publish them to a hosting site. Using the development tools in Visual Web Developer, you can develop Web pages on your own computer. Visual Web Developer includes a local Web server that provides all the features you need to test and debug Web pages, without requiring Internet Information Services (IIS) to be installed.When your site is ready, you can publish it to the host computer using the built-in Copy Web tool, which transfers your files when you are ready to share them with others. Alternatively, you can precompile and deploy a Web site by using the Build Web Site command. The Build Web Sitecommand runs the compiler over the entire Web site (not just the code files) and produces a Web site layout that you can deploy to a production server.Finally, you can take advantage of the built-in support for File Transfer Protocol (FTP).Using the FTP capabilities of Visual Web Developer, you can connect directly to the host computer and then create and edit files on the server. Web Sites and Web Application ProjectsUsing Visual Studio tools, you can create different types of projects, which includes Web sites, Web applications, Web services, and AJAX server controls.There is a difference between Web site projects and Web application projects. Some features work only with Web application projects, such as MVC and certain tools for automating Web deployment. Other features, such as Dynamic Data, work with both Web sites and Web application projects.Page and Controls FrameworkThe 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 samepage for multiple browsers, because renders the appropriate markup for the browser making the request. However, you can design your Web page to target a specific browser and take advantage of the features of that 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 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. The page framework also enables you to define the pattern for URLs that will be used in your site. This helps with search engine optimization (SEO) and makes URLs more user-friendly.The page and control framework is designed to generate HTML thatconforms to accessibility guidelines. CompilerAll 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.Security InfrastructureIn 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.State-Management Facilities 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 beindependent 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. 概述是一个统一的Web开发模型,它包括您使用尽可能少的代码生成企业级Web应用程序所必需的各种服务。
ASPNET英文概述
OverviewWhen ASP was first released,Web programming was more difficult because you needed IIS to serve your ASP ter,2.0and Visual Studio®2005made 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.we will introduce 2.0technology from different aspects. Framework Class Library is part of Microsoft's framework,which contains a vast set of programming classes designed to satisfy any conceivable programming need.because 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.what’s more,these languages contain similar programming constructs,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.Maintaining all this functionality for multiple languages requires a lot of work.Wouldn't it be easier to create all this functionality once and use it for every language?however, Framework Class Library does exactly that.It consists of a vast set of classes designed to satisfy any conceivable programming need.For instance, 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.furthermore, framework contains classes that represent all the basic variable data types such as strings,integers,bytes,characters,and arrays. framework is huge.It contains thousands of classes(over3,400). Fortunately,the classes are not simply jumbled together.The classes of framework are organized into a hierarchy of namespaces.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 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.The 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 specialized collections 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 and authorization 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.You can choose C#or or C++or Visual Basic to program page.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 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 iscompiled,it is not compiled directly into machine code.Instead,it is compiled into an intermediate-level language called Microsoft Intermediate Language(MSIL).-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 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.2.Building Forms with Web Server ControlsUseingseveral 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..3.Performing Form Validation with Validation ControlsTraditionally,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 form field,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 codefunctions correctly with any browser,this course of action was safer.At the same time, 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.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 with50form 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 the48th 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 want to break the tax form into multiple pages so that a person views only one part of the tax form at a time.you can set the Visible and Enabled properties with individual controls and groups of controls to hide and display page ing 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 either pre-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 version4.0or 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.5.Web Deployment ProjectsThe beauty of the 2.0is that you can develop your Web application without thinking about packaging and deployment.when need another class,you can Add a.cs file to the App_Code directory and start writing.When want to store localizable strings in a resource file,you can 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.6.C#LanguageIntroduction to the C#Language and 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 Framework.You can use C#to createtraditional Windows client applications,XML Web services,distributed components, client-server applications,database applications,and much,much more.Microsoft Visual C#2005provides an advanced code editor,convenient user interface designers,integrated debugger,and many other tools to facilitate rapid application development based on version2.0of the C#language and Framework.C#syntax is highly expressive,yet with less than90keywords,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 Win32DLLs,you can do this in C#through a process called"Interop."Interop enables 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 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 thecompile-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 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 versions of Visual Basic,Visual C++,Visual J#,or any of more than20 other CTS-compliant languages.A single assembly may contain multiple modules written in 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, Framework also includes an extensive library of over4000classes organized into names paces 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 Framework class library extensively to handle common "plumbing"chores.。
外文翻译译文
概述是一个统一的Web开发模型,包括必要的服务为您构建企业级的Web应用程序提供了一个最小的编码。
是.NET框架的一部分,当你编码时你可以访问网络应用程序中的类,净框架。
你可以用任何语言编写应用程序兼容公共语言运行时(CLR),包括微软Visual Basic、c#、JScript和J #。
这些语言使您能够开发网络应用而受益的公共语言运行时,类型安全、继承等等。
包括一个页面和控件框架净编译器安全基础设施状态管理设施应用程序配置健康监测和性能特性调试支持XML Web服务框架可扩展的托管环境和应用程序生命周期管理一个可扩展的设计环境净页面和控件框架是一个编程框架,运行在一个Web服务器来动态地产生和渲染净的Web页面。
网页可以要求从任何浏览器或客户端设备, 净呈现标记(如HTML)来请求浏览器。
通常,您可以使用相同的页面,因为ASP多个浏览器。
净呈现适当的标记为浏览器发出请求。
然而,你可以设计你的网页针对一个特定的浏览器,比如微软Internet Explorer 6和利用特性的浏览器。
网络支持移动控制网络设备,如移动电话、掌上电脑、个人数字助理(pda)。
网页是完全面向对象的。
在您可以处理Web页面的HTML元素使用属性、方法和事件。
净页面框架删除的实现细节分离的客户机和服务器中固有的基于web的应用程序提供一个统一的模型,为响应客户端事件代码,运行在服务器上。
该框架还自动维护页面状态和控制页面,在该页面处理生命周期。
净页面和控件框架还允许您封装常见的UI功能易用、可重用控件。
控制只写一次,可以用在很多页面,并集成到净的Web页面,他们被安置在呈现期间。
净页面和控件框架还提供了功能控制的总体外观和感觉你的网站通过主题和皮肤。
你可以定义主题和皮肤,然后将它们应用在页面级别或在控制水平。
除了主题,您可以定义主网页,您可以用它来创建一个一致的布局的页面在您的应用程序。
一个母版页定义布局和标准的行为,你要对所有的页面(或一组页)在您的应用程序。
软件外文翻译外文文献英文文献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. Y ou 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. Y ou 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. Y ou 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. Y ou 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. Y ou 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. Y ou 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. Y ou 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. Y ou 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. Y ou 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. Y ou 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 应用程序所必需的各种服务。
软件 外文翻译 外文文献 英文文献 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 窗体页框架是一种可用于在服务器上动态生成网页的可伸缩公共语言运行库编程模型。
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.外文文献译文是什么?是一个能在规划好框架的服务器上建造强大的网络应用。
ASPNET简明教程 第1章 ASPNET概述
建立的运行环境
•IIS •MDAC •.NET Framework和
IIS
• IIS是在Windows启动的时候自动启动的。 •
目录管理
• 设置主目录 • 虚拟目录并不是一
个真正存在的物理 目录,而是服务器 上物理目录的一个 别名。
执行过程中进行的,那么就是解释 –在程序的执行过程中进行的,所以没有办法对程 序进行相关的优化
HTTP请求和HTTP响应
• 用户在浏览器中输入
HTTP请求 • HTTP 请求通过 Internet 找到相应的 Web 服务器, 并把这个请求传给这个 服务器相应的处理模块 • 执行结果通过Internet返 回给客户端,形成 HTTP响应。
ASP
• ASP是一种允许用户将HTML或XML标记与
VBScript代码或者JavaScript代码相结合生成动态页 面的技术,当一个页面被访问时, VBScript/JavaScript代码首先被服务器处理,然后 将处理后得到HTML代码发送给浏览器。 • ASP只能建立在Windows的IIS Web服务器上 • 所有的代码都是解释执行的,所以相对速度较慢。 • VBScript/JavaScript 代码的结构性不好,所以导致 代码不好理解。
– 应用程序实际上就是一个纯文本的文件,这个文
件的实际编译工作是向IIS第一次发出对这个文件的HTTP 请求时由进行的,只要有一个文本编辑器就可以 进行程序设计。
ASP的编码方式
• 使用的是VBScript或者JavaScript这样的脚本
语言,并在HTML代码中需要编写程序的地 方插入代码 • 插入代码的方法是把代码写到<% %>符号中 间
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程序。
网络应用程序ASP中英文对照外文翻译文献
中英文资料外文翻译文献Moving from Classic ASP to ABSTRACT is Microsoft new offering for Web application development, innovation within have resulted in significant industry popularity for this product. Consequently there is an increased need for education. The Web Application Development is a third year undergraduate course. To meet the demands of both industry and students, we have changed the focus of this course from Classic ASP to . This paper reports this move. The significant features of and the motivations for this move are discussed. The process, the problems encountered, and some helpful online learning resources are described.Key wordsWeb Application Development, Classic ASP, , Move, 1. INTRODUCTION is not just a new version of ASP. It provides innovation for moving Windows applications to Web applications. Web services and the .NET framework have made the vision of the Web as the next generation computing platform a reality. With server controls, Web forms and “code-behind”, we can develop a Web application by using a complete object-oriented programming (OOP) model. This increases the popularity of in industry. The industry project is the final course of the Bachelor of Computing Systems (BCS) degree at UNITEC, in which students undertake a real-world project. We have observed a rapid growth of related industry projects in our school.The Web Application Development (WAD) paper is a third year undergraduate course. It was originally offered using ASP 2.0 and ColdFusion. To meet the demands from both industry and students, we have changed the course content to cover , Visual () and ColdFusion. This change commencedwith the first semester of 2003.This paper will examine the features of and explain why these are unique. The motivations for moving to are discussed by analyzing the current situation of related to industry projects in our school, analyzing the results of short surveys on students, and analyzing whether is a better tool for teaching. Problems encountered during the move are also discussed and some of the learning resources are presented. It is anticipated that these will be helpful for teachers who intend to introduce .2. WHAT MAKES SPECIAL?There are many articles on the Internet discussing the advantages of over Classic Active Server Pages (ASP), such as that introduces an integrated development environment (IDE), a single development library for all types of applications, compiled as well as strongly typed code, and a true OO approach to Web application development (Goodyear, 2002, Bloom, 2002).Traditionally, we have three versions of ASP (ASP 1.0, ASP 2.0 and ASP 3.0), which are called Classic ASP. Although each version provides certain new features to overcome the shortcomings of its predecessors, these versions of ASP follow the same working model and share many limitations. Their successor supports complete new working model while preserving the traditional working model and provides innovative techniques to overcome the limitations of Classic ASP.2.1. Architecture enhances and extends the Windows DNA (Windows Distributed interNet Application). The windows DNA specification is a methodology for building n-tier applications using Microsoft (DCOM/COM) technologies. Breaking applications into functional pieces and deploying these across a network is a strategy to make better use of organizational resources. This needs a well-planned architecture. In the past, usually it was the windows DNA. DCOM communication normally has problems with firewalls and proxy servers. This means Windows DNA usually onlyworks well within an intranet, not on the Internet. DCOM/ COM also need registry entries. makes the process of creating and integrating Web Services easier, which can be used in a similar manner to the Windows DNA. Here DCOM/COM is no longer involved. HTTP (as channels), SOAP (as formatters) and XML are used for communication and data-transfer between distributed components. This overcomes the problem of communicating across the Internet and across corporate firewalls without resorting to proprietary solutions that require additional communications ports to be opened to external access. In addition, URI (uniform resource identifier) and UDDI (Universal Description Discovery and Integration) are used for remote components references instead of registry entries.2.2. Development integrates seamlessly with IDE. includes built-in support for creating and modifying content. This unifies the ASP/VB programming models for the developers. Instead of opening multiple IDEs (as with Classic ASP platform), developers can open a single IDE and do all their work from a clean, consistent interface. is equipped with powerful debugging environment. This means that the powerful debugger for Windows applications is now available to debug Web applications as well. enables programmers to take advantage of the OOP model, for example, code sharing. Under OOP model, one of the most common ways to achieve code sharing is inheritance, which is not available in Classic ASP. Since complete OO features are supported in , developers can transfer their OO design smoothly into code, enabling a software company to keep their Windows application development styles, with which they are familiar, in Web application development; and also they can convert their Windows applications into Web applications without major modifications.’s improved state maintenance features enable us to provide users with Web applications that are richer and faster than Classis ASP (Olges,2002). supports advanced session state management. There are two major problems with session management in Classic ASP: session objects are stored in the Web server memory and session IDs are stored on the client computers as cookies. These prevent session management from being efficiently implemented. solves these problems in two ways: it provides a “cookieless” option for session objects so that a session ID can be passed via URL; it provides three different session modes (inprocess, state server, and SQL Server), so that a session object can either be stored on the Web server, a remote server or a database.3. THE MOTIVATIONS FOR MOVING3.1. The industry motivationI’ve checked almost all the industry projects in our school for three semesters on whether they are WAD related, if yes, then what tools they have used. Table 1 shows a brief summary of the results.For these three semesters, the total ASP/ projects are increasing, but slowly. However the Classic ASP projects are dropping quickly and the projects are increasing rapidly (in the speed of more than 12% per semester). This gives us an idea that is preferred over Classic ASP in industry especially given that is only officially first released in 2002. Our student’s feedbacks from their industry communication confirm this view. A huge number of articles on the Internet also support this view. This encourages us to drop Classic ASP and move to in our WAD course. Higher education has over years recognized that it is a service industry and has to revaluate their approach in the industry by placing greater emphasis on meeting the expectations and needs of their stakeholders (Nair, 2002). 3.2. The student motivationThe students demand . When students enroll in our WAD course, most of them are aiming to become a professional software developer. As a matter of fact, some of them already are software developers, or they were software developers and are seeking to return to the workplace. Techniques highly demanded in workplace are of great interest to them.A short survey has been given to past students and current students respectively. For the past students, among the 11 responses, 100% students still want to learn ; and if they are given choice, 82% students prefer to learn rather than Classic ASP, 18% students like to learn both. These answers are also supported by comments, such as “I would prefer to know the technology that the industry requires me to work with”, “I would like to work in future as a WAD professional andI think would be usefu l in this field.” For the current students, among the16 responses, 75% students prefer to learn rather than Classic ASP. However, 25% students answered no idea. This could be due to that they lack of knowledge of Classic ASP. This survey is done after 6 weeks of teaching.3.3. The pedagogical motivationPedagogically speaking, a good tool for industry is not necessarily a good tool for teaching. Is a better tool for teaching than Classic ASP? provides much richer language features than Classic ASP. We often have options to perform certain tasks. A key benefit of is that there exists a more gradual transition in programming models from simple to powerful, or from easy to difficult. Although supports OOP model, you don’t have to program by using that model. A Web form without “code-behind” will work perfectly. An web page in complete Classic ASP model will still work. Although is integrated with , we are not limited to use . A notepad and a FTP client with a pre-created Web application directory also allow us to develop a reasonably large application. With , we can either develop a large distributed application with numbers of Web services and consumers, or develop a single simple Web application. Therefore, provides sufficient room for us to organize course materials at a suitable level for the students. The challenge for a lecturer is how to settle in at the right balance of power vs. simplicity, or at the right balance of difficulty vs. ease. offers a more conventional approach to programming than does Classic ASP. It possesses all the features of a modern programming language. The Classic ASP programming style favors developers coming from HTML coding background, whereas is more suited to professional software developers. Given our entire WAD students have taken C/Delphi programming courses, and our aim is to output software professionals, is a better teaching tool for us. enhances the programming concepts the students learned from the previous courses and provides a good bridge to Advanced Distributed Computing and Advanced Object- Oriented Programming.4. THE PROCESSOur first step was to learn . After reading books and online tutorials, the next step is practical. We set an implementation server on the laptop in a stand-alone environment. The .NET Framework requires IIS 5 and the above; Windows 2000 or Windows XP professional will work with .NET. However, Windows XP home edition or Windows 98 won’t work. On the client side, we can either use or WebMatrix. Among these, only costs money. The .NET Framework is included inside the package. We also can download the .NET Frameworkfrom the Internet. After the .NET Framework is installed, the QuickStart Tutorial is set up. It is also found on the Internet. This tutorial is a good starting point for experienced developers. It is claimed that the readers “should be fluent in HTML and general Web development term inology. …… should be familiar with the concepts behind interactive Web pages, including forms, scripts, and data access.” More complicated examples can be found from Microsoft .NET Framework SDK Documentation or Microsoft Visual Studio .NET Documentation.The second step was to test the teaching environment. A teaching server was set up for the Intranet on campus. It is configured for the client computers in the teaching lab. is installed on the client computers. provides two ways to access the Web server: FrontPage server extensions and File share. The FrontPage server extension is used on our teaching server. Programming testing has been done on all the major aspects of WAD. Except a few special ones, most of the problems occurred during the testing were minor problems which, after the communication with our Web technician, were resolved.Teaching materials have been updated. The major changes have been made on the data interaction, form and controls, application/session management, and error handling. Given that has made XML very practical and the using of Web service much easier. A lecture on XML and Web service has been added. As a result, ColdFusion lectures are reduced. The assessment has been adjusted accordingly. 5. THE PROBLEMSWe have to admit that with is a much more complicated client server environment than the Classic ASP environment. This complexity comes from the configuration system and the integration between the client computers and the Web server.On server, each level of the application directory can have a configuration file. All these configuration files are optional except Machine.config. A developer has full control over those optional configuration files. Developers become more involved with the server settings via these files. One problem that happened to several students and myself on our home servers is the permission problem. We found our applications didn’t have permission to write to database/XML files. Microsoft (2003) provides three solutions to this problem. The simplest one is to change the Machine.config file and set the username attribute to SYSTEM in the <processModel> section.We observed that behave differently in a stand-alone environment, asingle user client server environment, and a multiple user client server environment. A few problems don’t occur in the first two environments occur frequently in the last environment. The major one is when we try to create a new project or open an existing project, we often get an error message, “The user name or password you entered is incorrect, or you do not have authorization to permit this operation”, even if our user name and password are perfectly correct. This problem seems to be caused by FrontPage server extensions. Regularly cleaning VSWebCache partially solved the problem. This approach is confirmed by Kiely (2003).Another problem is a debug problem. When we try to use Debug|Start or Debug|Start Without Debugging in the multiple user client server environment within , we often get error messages. “…… Unable to start debugging on the web server. ……”. However,we don’t have the same problem for Debug|Start Without Debugging in the single user client server environment. We don’t have any problem in a standalone environment. After adding users to the debugging group on the server, the problem still exists. The reason of this problem is not clear to the author.6. RESOURCESThere is a huge amount of helpful online learning resources related to . Here are a couple of them, which are particularly helpful to the author./aspxtreme/. Accessed April 17, 2003. This site provides many tutorials covering wide range concepts. They usually show you how to do a particular task step by step. Some of the examples have both C# and VB versions./resources/spcollections/aspnet/default.asp. Accessed April 17, 2003. This site provides many articles from intermediate level to highly technical level. These articles are mostly from online magazines and they discuss many interesting topics in ./aspnet/. Accessed May 5, 2003. This site provides free source code and tutorials for developers. We can find complete examples for some typical tasks./. Accessed May 5, 2003. This site provides wide range of tutorials for different levels of readers. This is my favorite site. I’ve been with it since Classic ASP. I found that whenever I meet a challenging problem, I always find a solution here./tutorialsindex.aspx. Accessed May 5, 2003. This site provides wide range of articles for different levels of readers. Articles are groupedaccording to topics, which is very helpful when we do research on a particular topic.7. CONCLUSIONMoving from Classic ASP to has proven to be a challenging and exciting process. The author has learned a lot in this process. From the responses to our six-week survey, 100% students feel our WAD course challenging. However, most of them still prefer to learn rather than Classic ASP. We feel confident about the move. The issue is how to organize the course and help the students meet the challenge. is certainly an outstanding tool for both teaching and development. As a new development platform, we do need some time to absorb all the new features.从经典ASP到摘要是微软公司基于网络应用程序新开发出的产品,这个产品的普及在的创新当中具有重大意义,因此在方面的教育有了很大的需求。
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)。
毕业设计(论文)外文资料翻译题目: 概述院系名称:信息科学与工程学院专业班级:计算机科学与技术05级6班学生姓名:学号:指导教师:教师职称:起止时间:地点概述当ASP第一次发布时,Web编程还比较困难,因为需要IIS来处理ASP页。
后来,和Visual Studio®2005通过引入网站开发模型使一切工作都变得容易了。
借助该网站模型,您不必在Visual Studio 中创建新项目,而是可以指向一个目录并开始编写网页和代码。
此外,您还可以使用内置的Development Server快速测试站点,Development Server将寄宿在一个本地进程中,并消除了必须安装IIS才能进行开发这一先决条件。
下面从不同的方面来介绍技术。
类库是微软.NET framework整体的一部分,它包含一组大量编程用的类,满足各种编程需要。
因为Visual Basic、JScript和C++这些编程语言的很多功能具有重叠性。
举例来说,对于每一种语言,你必须包括存取文件系统、与数据库协同工作和操作字符串的方法。
此外,这些语言包含相似的编程构造。
都能够使用循环语句和条件语句。
即使用Visual Basic写的条件语句的语法和用C++的不一样,程序的功能也是相同的。
对于多种语言来说维持这一功能需要很大的工作量。
那么对所有的语言创建这种功能一次,然后把这个功能用在每一种语言中岂不是更容易。
然而.NET类库不完全是那样。
它含有大量的满足编程需要的类。
举例来说,.NET类库不仅包含处理数据库访问的类和文件协同工作,操作文本和生成图像,而且还包含更多特殊的类用在正则表达式和处理Web协议。
此外.NET framework,也包含支持所有的基本变量数据类型的类,比如:字符串、整型、字节型、字符型和数组。
.NET framework是庞大的。
它包含数以千计的类。
(超过3,400)幸运地是,类不是简单的堆在一起。
.NET framework的类被组织成有层次结构的命名空间。
一个命名空间包含一组逻辑的类。
举例来说,涉及到与文件系统协同工作的类就集合在命名空间中。
命名空间被组织成一个层次结构(一棵逻辑树)。
树根就是SYSTEM 命名空间。
这个命名空间包含基本的数据类型的所有的类,例如:字符串、数组,还包含提供随机数字和日期的类。
你通过完整的类的命名空间能唯一识别任何的类在.NET framework中的位置。
例如,指定找到一个the File class类,按如下操作:.文件指命名空间,而文件指定特定的类。
在默认情况下,在你的页面中,类被包含在一个选定的命名空间中这些默认的命名空间使你在中最常用到的。
System命名空间-包含所有的基本数据类型和其他有用的类,例如:那些关于产生随机数字和日期的类。
命名空间-包含的类是标准的集合类,例如:哈希表,数组列表。
命名空间-包含特殊的集合类,例如:连接列表和字符串集合。
命名空间-包括files类。
命名空间-包含编码,解码和操作字符串内容的类。
命名空间-包含的是匹配正则表达式和替代操作类。
命名空间-工作在万维网方面包含的是浏览器请求和服务器响应的类。
命名空间-包含页面缓冲内容和自定义缓冲操作的类。
命名空间-包含执行验证和授权,例如:窗体和密码验证的类。
命名空间-包含执行保存状态的类。
命名空间-包含构建页面的用户接口的类。
命名空间-包含HTML控件的类。
命名空间-包含Web控件的类。
.Net支持C#,,C++和Visual Basic中的任一种语言作为你的编程语言来完成程序编写。
但不管你使用什么语言开发页面,你需要明白在执行前必须编译,这就意味着执行速度非常快。
第一次请求页面,页面被编译成一个.NET类,这个类文件被保存在一个特殊的目录下,这个目录的名字叫Temporary Files。
对于一个页面一个通信类文件也会出现在Temporary Files目录下。
以后不管任何时候你请求那个同样的页面,那个通信类文件就会执行。
当页面被编译的时候,它没被直接地被编译成机器码而是被编译成了一个中间语言,名字叫MSIL,所有.NET可用的语言都被编译成这种中间语言。
一个页面不会被编译成本地机器码直到它被一个浏览器访问,在那个时间点包含在Temporary Files目录下的类文件用JIT编译器编译并且执行。
这些迷惑的方面体现在整个过程中且都在后台运行,你必须要做的是用资源代码为你的页面创建一个文本文件。
2.用Web服务器控件创建窗体用几个基本Web控件来代替标准的HTML窗体元素,例如radiobuttons、textboxes, and listboxes.在Web应用程序中可以用这些控件创建用户界面。
3.用验证控件做页面验证传统地,当增加验证到页面中时,会面临一个严峻的选择。
你可以添加窗体页面验证规则到你的服务器端代码,也可以添加验证规则到你的客户端代码。
写验证代码到客户端代码中的优势能够及时反馈到你的用户。
例如,一个使用者忽略输入一个要求检验的字段,你能够及时的显示一个错误信息而不需要返回到服务器端解决。
人们喜欢客户端的验证。
它能产生一种很好的效果。
然而,问题是它不与所有的浏览器兼容。
不是所有的浏览器支持JavaScript、不同版本的浏览器的不同版本支持JavaScript,所以客户端验证没有保障。
由于这个原因,许多开发者决定添加自定义验证到服务器端。
因为服务器端代码能够和任何浏览器协同工作。
这样的做法是更有安全保障。
同时这些验证控件会自动地产生客户端代码和服务器端代码。
如果一个浏览器有能力支持JavaScript,客户端的验证脚本将会自动返回到浏览器。
如果一个浏览器不支持JavaScript,那个验证规则会自动在服务器端代码中执行。
控制字段:RequiredFieldValidator控件你可以用这个控件来检查在一个Web窗体中是否为空,典型地,你和TextBox控件一起使用这个控件。
然而,这个控件也可以和其他的输入型控件结合使用,例如:RadioButtonList控件。
验证表达式:RegularExpressionValidator控件你能使用RegularExpressionValidator控件来验证输入的值是否和定义的正则表达式相匹配。
例如:你能使用这控件来检查一个用户是否输入一个合法的电子邮件地址,电话号码,用户名或密码。
比较值:CompareValidator控件这个CompareValidator 控件用于比较一个输入的数据和另外一个值是否相同。
另外一个值可能是固定值,例如:一个特定的数字或者是输入到另一个控件中的一个值。
总结错误:ValidationSummary控件假想一个页面有50个字段假如你仅仅用上部分讨论的那些验证控件来显示错误看见一个错误在页面中将是很难的。
例如:你可能需要滚动到第48个页面字段来找到这个错误信息。
幸好,微软除了包含上面提到的控件还包括ValidationSummary控件。
你能用这个控件综合所有的错误信息在一个页面的上端或者你想要的任何一个地方。
4.先进的控件编程保存浏览状态默认地,几乎所有的控件都会在先前的窗体中保留他们的属性值。
举例来说,如果你输入文本到一个Lebel标签上然后提交那个页面,当那个页面再次被访问时那个Lebel标签的内容将会被保存下来。
浏览状态的妙处是它不依赖任何的特定服务器或浏览器的属性。
尤其,它不依赖cookies,session变量、或应用程序变量。
浏览状态在一个名叫做VIEWSTATE的隐藏页面中执行,这个隐藏页面自动创建每个Web窗体。
当应用时,浏览状态能够在你的网站中产生艺术性的积极效果,例如:你在一个支持浏览状态的控件中显示数据库数据,你不需要每次都返回到需要反馈到服务器的数据库页面。
它能够自动地保存页面里的数据状态。
显示和隐藏内容假想把一个form变成很多页面,以便一个人每次只看那个form的一个部分。
可以设置单个控件和一组控件的Visible and Enabled属性来隐藏和显示页面内容。
使用Visible and Enabled属性每个控件,包括HTML和Web控件,有一个Visible 属性来决定那个控件是否可见。
当一个控件的Visible是false值,那个控件就不会在页面上显示;那个控件也不会进一步运行。
Web控件(不是每个HTML控件)还有一个叫Enabled的属性。
当Enabled的属性是false 值,你用的浏览器是或更高的版本那个控件被封住了,也不起作用了,当用其他的浏览器的时候,如:网景浏览器那个控件不会被封,但它也是不起作用的。
部署项目的魅力在于您在开发Web应用程序时无需考虑打包和部署。
当需要其他类时可向App_Code目录添加一个.cs文件即可开始编写。
当希望将可本地化的字符串存储在资源文件中时,可向App_GlobalResources目录添加一个.resx文件并键入字符串。
一切都顺顺当当,根本就不必考虑编译和部署方面的事情。
在准备进行部署时,有多种可选方案。
最简单的方案是将文件复制到主运行服务器并按要求编译每一个文件(和在测试环境中一样)。
第二种方案是使用实用工具将应用程序预编译为二进制版本,之后将只剩下要放到服务器上的一组程序集、静态内容和配置文件。
第三种方案也使用,但要创建一个可更新的二进制部署,其中.as*x文件保持不变(并且可修改),而所有代码文件都编译为二进制程序集。
6. C#语言C# 是一种简洁、类型安全的面向对象的语言,开发人员可以使用它来构建在.NET Framework 上运行的各种安全、可靠的应用程序。
使用C#,您可以创建传统的Windows 客户端应用程序、XML Web services、分布式组件、客户端- 服务器应用程序、数据库应用程序以及很多其他类型的程序。
Microsoft Visual C# 2005 提供高级代码编辑器、方便的用户界面设计器、集成调试器和许多其他工具,以在C# 语言版本和.NET Framework 的基础上加快应用程序的开发。
C# 语法表现力强,只有不到90 个关键字,而且简单易学。
C# 的大括号语法使任何熟悉C、C++ 或Java 的人都可以立即上手。
了解上述任何一种语言的开发人员通常在很短的时间内就可以开始使用C# 高效地工作。
C# 语法简化了C++ 的诸多复杂性,同时提供了很多强大的功能,例如可为空的值类型、枚举、委托、匿名方法和直接内存访问,这些都是Java 所不具备的。
C# 还支持泛型方法和类型,从而提供了更出色的类型安全和性能。
C# 还提供了迭代器,允许集合类的实现者定义自定义的迭代行为,简化了客户端代码对它的使用。
作为一种面向对象的语言,C# 支持封装、继承和多态性概念。