关于ASP.NET的毕业设计论文外文翻译
ASP NET 5外文文献和翻译
![ASP NET 5外文文献和翻译](https://img.taocdn.com/s3/m/98ba69fce009581b6ad9eb16.png)
5 : Introducing the 5 PreviewDaniel Roth | Special connect(); issue 2014 shipped as part of the Microsoft .NET Framework 1.0, released in 2002 along with Visual Studio 2002. It was an evolution of Active Server Pages (ASP) that brought object-oriented design, the .NET Base Class Libraries (BCLs), better performance and much more. was designed to make it easy for developers used to writing desktop applications to build Web applications with Web Forms. As the Web evolved, new frameworks were added to : MVC in 2008, Web Pages in 2010, and Web API and SignalR in 2012. Each of these new frameworks built on top of the base from 1.0.With 5, is being reimagined just like ASP was reimagined to in 2002. This reimagining brings many new features:•Full side-by-side support: 5 applications can now be installed on a machine without affecting any other applications on the machine.•Cross-platform support: 5 runs and is supported on Windows, Mac and Linux. •Cloud-ready: Features such as diagnostics, session state, cache and configuration are designed to work locally and in the cloud.•Faster development: The build step is removed; just save source files and refresh the browser and compilation happens automatically.•MVC, Web Pages and Web API: These are all merged together, simplifying the number of concepts.•Flexible hosting: You can now host your entire 5 application on IIS or in your own process.Getting Started with 5 PreviewIn this article, I’ll give an overview of the new experiences the development team—of which I’m a part—has created for 5 and Visual Studio 2015 Preview. For general help with building and running 5 applications, visit /vNext, where you can findstep-by-step guides and additional documentation. In addition, we also post updates regularlyto /b/webdev. To get started, download and install Visual Studio 2015 Preview. Overview of the 5 Runtime 5 has been rebuilt from the ground up to support building modern Web applications and services. It’s open source, cross-platform and works both on-premises and in the cloud. 5 is currently in Preview and under active development on GitHub (/aspnet). I’llprovide an overview of what’s new in the 5 Preview along with pointers to where you can learn more.Flexible, Cross-Platform Runtime At its foundation, 5 is based on a new flexible runtime host. It provides the flexibility to run your application on one of three different runtimes: 1.Microsoft .NET Framework: You can run your 5 applications on the existing .NETFramework. This gives you the greatest level of compatibility for existing binaries. Core: A refactored version of the .NET Framework that ships as a set of NuGet packagesthat you can include with your app. With .NET Core, you get support for true side-by-side versioning and the freedom to use the latest .NET features on your existing infrastructure. Note that not all APIs are available yet on .NET Core, and existing binaries generally need to be recompiled to run on .NET Core.3.Mono: The Mono CLR enables you to develop and run 5 apps on a Mac or Linuxdevice. For mor e information, see the blog post, “Develop vNext Applications on a Mac,” at bit.ly/1AdChNZ.Regardless of which CLR is used, 5 leverages a common infrastructure for hosting the CLR and provides various services to the application. This infrastructure is called the K Runtime Environment (KRE). While it’s somewhat of a mystery where the “K” in KRE comes from (a tribute to the Katana Project? K for Krazy Kool?), the KRE provides everything you need to host and run your app.A New HTTP Pipeline 5 introduces a new modular HTTP request pipeline that can be hosted on the server of your choice. You can host your 5 applications on IIS, on any Open Web Interface for .NET (OWIN)-based server or in your own process. Because you get to pick exactly what middleware runs in the pipeline for your app, you can run with as little or as much functionality as you need and take advantage of bare-metal performance. 5 includes middleware for security, request routing, diagnostics and custom middleware of your own design. For example, here’s a simple middleware implementation for handling of theX-HTTP-Method-Override header:e((context, next) =>{var value = context.Request.Headers["X-HTTP-Method-Override"];if (!string.IsNullOrEmpty(value)){context.Request.Method = value;}return next();}); 5 uses an HTTP pipeline model similar in many ways to the OWIN-based model introduced with Project Katana, but with several notable improvements. Like Katana, 5 supports OWIN, but simplifies development by including a lightweight and easy-to-use HttpContext abstraction.There’s a Package for That Package managers have changed the way developers think about installing, updating and managing dependencies. In 5, all your dependencies are represented as packages. NuGet packages are the unit of reference. 5 makes it easy to build, install and use packages from package feeds and also to work with community packages on the node package manager (NPM) and Bower. 5 introduces a simple JSON format (project.json) for managing NuGet package dependencies and for providing cross-platform build infrastructure. An example project.json file is shown in Figure 1 (a more detailed explanation of each of the supported properties can be found on GitHub atbit.ly/1AIOhK3).Figure 1 An Example project.json File{"webroot": "wwwroot","version": "1.0.0-*","exclude": ["wwwroot"],"packExclude": ["**.kproj","**.user","**.vspscc"],"dependencies": {"Microsoft.AspNet.Server.IIS": "1.0.0-beta1","Microsoft.AspNet.Diagnostics": "1.0.0-beta1"},"frameworks" : {"aspnet50" : { },"aspnetcore50" : { }}}The Best of C# Design-time and run-time compilation for 5 applications are handled using the managed .NET Compiler Platform (code-named “Roslyn”). This means you get to take advantage of the latest C# language features while leveraging in-memory compilation to avoid unnecessary disk I/O. 5 projects are based on a new project system that dynamicallycompiles your application on-the-fly as you’re coding so you can avoid the interruption of a specific build step. This gives you the power of .NET and C# with the agility and feel of an interpreted language.Built-in Dependency Injection All 5 applications have access to a common dependency injection (DI) service that helps simplify composition and testing. All the frameworks built on 5 (MVC, Web API, SignalR and Identity) leverage this common DI service. While 5 comes with a minimalistic Inversion of Control (IoC) container to bootstrap the system, you can easily replace that built-in IoC container with your container of choice.Familiar Web Frameworks 5 includes frameworks for building Web apps and services such as MVC, Web API, Web Pages (coming in a future release), SignalR and Identity. Each of these frameworks has been ported to work on the new HTTP request pipeline and has been built to support running on the .NET Framework, .NET Core or cross-platform.Today, the existing implementations of MVC, Web API and Web Pages share many concepts and duplicate abstractions, but share very little in the way of actual implementation. As part of porting these frameworks to 5, Microsoft decided to take a fresh look at combining these frameworks into a single unified Web stack. MVC 6 takes the best of MVC, Web API and Web Pages and combines it into a single framework for building Web UI and Web APIs. This means from a single controller you can just as easily render a view as return formatted data based on content negotiation.In addition to unification, MVC 6 introduces a host of new features:•Built-in DI support•Ability to create controllers from any class—no base class required•Action-based request dispatching•View Components—a simple replacement for child actions•Routing improvements, including simplified attribute routing•Async views with flush points•Ability to inject servers and helpers into views using @inject•ViewStart inheritance•Tag helpersYou can find more information and samples at /aspnet/mvc.Web Forms isn’t available on 5, but is still fully supported on the .NET Framework. There are a number of important new features coming to Web Forms in the upcoming version of the .NET Framework, including support for HTTP 2.0, async model binding and a Roslyn-based CodeDom provider. We’re also working on various features reminiscent of Web Forms in MVC 6, such as tag helpers and other Razor improvements.Entity FrameworkData is a key part of many applications and Entity Framework (EF) is a popular data access choice for developers. While EF7 isn’t specific to , this new version of EF plays an integral role in 5.EF7 Enables New Platforms EF is widely used in client and server applications that target thefull .NET Framework. A key focus of EF7 is to enable EF to be used on the remaining platforms where .NET development is common. These include 5, Windows Store and Windows Phone applications, as well as .NET-based Mac and Linux applications.For Windows Phone and Windows Store applications, the initial goal is to provide local data access using EF. SQLite is the most common database of choice on devices and will be the primary store for local data on devices with EF7. The full provider model will be available, though, so other data stores can be supported also.EF7 Enables New Data Stores While parts of EF are clearly tied to relational data stores, muchof the functionality that EF provides is also applicable to many non-relational data stores. Examples of such functionality include change tracking, LINQ and unit of work. EF7 will enable providers that target non-relational data stores, such as Microsoft Azure Table Storage.We’re explicitly not trying to build an abstraction layer that hides the type of data store you’re targeting. The common patterns/components that apply to most data stores will be handled by the core framework. Things specific to particular types of data stores will be available asprovider-specific extensions. For example, the concept of a model builder that allows you to configure your model will be part of the core framework. However, the ability to configure things such as cascade delete on a foreign key constraint will be included as extensions in the relational database provider.EF7 Is Lightweight and Extensible EF7 will be a lightweight and extensible version that pulls forward some commonly used features. In add ition, we’ll be able to include some commonly requested features that would’ve been difficult to implement in the EF6 code base, but which can be included from the start in EF7.The team will be keeping the same patterns and concepts you’re used to in EF, except where there’s a compelling reason to change something. You’ll see the same DbContext/DbSet-based API, but it will be built over building block components that are easy to replace or extend as needed—the same pattern used for some of the isolated components added in recent EF releases.More Information on EF7For more information on EF7, visit the “What Is EF7 All About” GitHub page at aka.ms/AboutEF7. The page includes design information, links to blog posts and instructions for trying out EF7. Command-Line ToolsOne of the core 5 tenets was to provide a command-line experience before we built the tooling experience. This means that almost all tasks you need to do with an 5 application can be done from the command line. The main reason for this is to ensure a viable option for using 5 without Visual Studio for those using Mac or Linux machines.KVM The first tool you need to get the full command-line experience for 5 is the K Version Manager (KVM). The KVM command-line tool can download new versions of the KRE and let you switch between them. KRE contains other command-line tools that you might use. How KVM is implemented, and how to get it, depends on the OS. You can download and install KVM for your platform by running the appropriate command from /aspnet/Home.Once you have KVM, you should be able to open a command prompt and run the kvm command. If you run “kvm list,” you’ll see the list of all KRE versions on your machine, as shown in Figure 2.Figure 2 Running “kvm list” at the Command Line to Get a List of KRE Versions on Your MachineIf there are no entries in your list, there are no versions of KRE in your user profile. To fix this, you can run the command “kvm upgrade.” This command will determine the latest version of the KRE available, download it and modify your PATH environment variable so you can use the other command-line tools in the KRE itself.You can use “kvm install <version/latest>” to install a particular version without making it the default. Use the –r switch to indicate whether you want the .NET Core or .NET Frameworkversion of the KRE and the –x86 and –amd64 switches to download the 32- or 64-bit flavors of the KRE. The runtime and bitness switches can be supplied to either install or upgrade.Once you’ve called “kvm upgrade,” you’ll be able to use the K and KPM commands. K can be used to run applications, while KPM is used to manage packages.How does KVM work? At its heart, KVM is just a convenient way to manipulate your PATH. When you use “KVM use <version>,” all it does is change your PATH to the bin folder of the KRE version you specified is on your PATH. By default the KRE is installed by copying and extracting the KRE .zip file into %USERPROFILE%\.kre\packages, so when you type “KVM use 1.0.0-beta1,” KVM will make surethat %USERPROFILE%\.kre\packages\KRE-CLR-x86.1.0.0-beta1\bin is on your PATH.KPM The next tool you’ll want to use is the KRE Package Manager (KPM). The KPM performs two main functions, with a few lesser features:1.You can run “kpm restore” in a folder with a project.json file to download all the packages your application needs.2.It provides the pack command, “kpm pack,” which will take your application and generate aself-contained, runnable image of your application. Here, image means a folder structure that’s designed to be copied to the server and run. It will include all the packages your application requires, as well as, optionally, the KRE on which you want to run the application.The restore command can be run in a folder that contains a project.json file. It will examine thefile and, using NuGet.config, connect to a NuGet feed and attempt to download all the packages your application needs. By default, it will install these packagesin %USERPROFILE%\.kpm\packages so only one copy of any given package needs to be on your dev machine, even if used in multiple projects.Packing your application—by running “kpm pack”—will generate a folder containing everything your app needs to run, including packages, source files and your Web root. You can even optionally include the KRE, although by default it’s assumed the KRE is already on the server.K Command The K command actually runs an 5 application from the command line. The K command is included in the KRE, the same as KPM, and is the entry point to running an application on top of the KRE.The main way to use the K command is to run one of the commands inside your project.json file. Commands are specified by name in the project.json file under the commands property. By default,the 5 Starter Web template includes a “web” command in project.json that hosts your app and listens on port 5000. To run th is command, simply run “k web.”Visual Studio Updates for 5One of the original goals of 5 was to have a great experience for teams in which members use different tools. For example, you can have team members using Windows and Visual Studio working with others who are using Sublime Text on a Mac (see options forcross-platform .NET development tools ). To achieve this, we had to take a step back and rethink Visual Studio support. In previous versions of Visual Studio, the project system assumed that most development was performed in Visual Studio. Visual Studio didn’t work well when other tools were involved to create files or modify the project. For example, in the .csproj file, Visual Studio maintained a list of files that made up the project. If you used a tool to create a new file for your project, you’d then have to edit the .csproj file for it to be included.In Visual Studio 2015, when you create a new 5 project, you get a new experience. You can still develop, debug and run your project as usual, but in addition to the standard features that you’ve come to know in projects, some new features are unique to 5. You now have the freedom to develop using the p latform and tooling of your choice. I’ll discuss some of those features.Support for All Files in the Folder In 5, all files under the project directory are automatically included in the project. You can exclude files from compile or publish in the project.json file. For more info on how to exclude files in project.json, see the GitHub pageat bit.ly/1AIOhK3. After the project is loaded, Visual Studio starts a file watcher and updates Solution Explorer to reflect the changes. Because Solution Explorer is always watching the files under the project directory, we’ve changed the location where generated files will be stored. Instead of storing generated files under the project (bin\ and obj\), we now place generated files by default in a folder named artifacts next to the solution file.Just Edit, Save and Refresh the Browser In existing applications, when you change server-side logic (such as your MVC controller code, or a filter) then you need to rebuild and redeploy the application to see the changes reflected in the browser. Microsoft wanted the Web developer workflow to feel as lightweight and agile as when working with interpreted platforms (such as Node.js or Ruby), while still letting you leverage the power of .NET. In 5 projects, when you edit and save your C# code, a file watcher detects the change and restarts the application. The application is rebuilt in memory, so you can see the results of the change in the browser in near-real time. Not e that this workflow is only supported when you aren’t debugging so as to avoid interrupting your debugging session.Web Publishing In Visual Studio 2015, Microsoft developers are working on a new publish process for 5 projects. In the Preview release, 5 publishing supports publishing to Azure Websites and to the file system (for example, local/network folder). When publishing to Azure Websites, you can select the desired build configuration and KRE version. Later releases will expand this to support a broader set of targets.Migrating to 5Moving existing Web applications to 5 involves both creating a new 5 project for your existing application and then migrating your code and dependencies to run on the new framework. Creating a new 5 project for your application is relatively simple. First, add a project.json file in your project folder. Initially, the project.json file only needs to include an empty JSON object (for example, {}). Next, use File | Open Project to open the project.json file in Visual Studio 2015 Preview. After opening the project.json file, Visual Studio will create an 5 project with a .kproj file and automatically include in the project all the files and directories it finds next to the project.json file. You should see your project files in your new 5 project in the Solution Explorer. You have now created an 5 project for your existing Web application!Migrating your code and dependencies so your new 5 project builds and runs correctly is a more involved process. You need to update your project.json with your top-level package dependencies, framework assembly references and project references. You need to migrate your code to use the new HTTP abstractions, the new middleware model and the new versions of the Web frameworks. You need to move to new infrastructure for handling concerns such as configuration, logging and DI. Porting your application to run on .NET Core requires dealing with additional platform changes and limitations. This is more than can be covered in this article, but we’re working hard to provide complete migration guidance in a future article. While the investment to move to 5 might be significant, Microsoft believes the benefits of providing an open source, community-driven, cross-platform and cloud-ready framework are worth the additional effort.翻译:是微软.NET Framework 1.0运作的一部分,与Visual Studio 2002版本一同发布在2002年。
计算机专业ASPNET外文翻译
![计算机专业ASPNET外文翻译](https://img.taocdn.com/s3/m/d589e863011ca300a6c390c2.png)
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);}。
毕业论文外文翻译两篇
![毕业论文外文翻译两篇](https://img.taocdn.com/s3/m/bf15b618be1e650e52ea9975.png)
毕业论文外文翻译两篇篇一:毕业论文外文翻译外文资料翻译译文:概述是一个统一的Web开发模型,它包括您使用尽可能少的代码生成企业级Web应用程序所必需的各种服务。
作为.NETFramework的一部分提供。
当您编写应用程序的代码时,可以访问.NETFramework中的类。
您可以使用与公共语言运行库(CLR)兼容的任何语言来编写应用程序的代码,这些语言包括MicrosoftVisualBasic、C#、和J#。
使用这些语言,可以开发利用公共语言运行库、类型安全、继承等方面的优点的应用程序。
包括:∙页和控件框架∙编译器∙安全基础结构∙状态管理功能∙应用程序配置∙运行状况监视和性能功能∙调试支持∙XMLWebservices框架∙可扩展的宿主环境和应用程序生命周期管理∙可扩展的设计器环境页和控件框架是一种编程框架,它在Web服务器上运行,可以动态地生成和呈现网页。
可以从任何浏览器或客户端设备请求网页,会向请求浏览器呈现标记(例如HTML)。
通常,您可以对多个浏览器使用相同的页,因为会为发出请求的浏览器呈现适当的标记。
但是,您可以针对诸如MicrosoftInternetExplorer6的特定浏览器设计网页,并利用该浏览器的功能。
支持基于Web的设备(如移动电话、手持型计算机和个人数字助理(PDA))的移动控件。
网页是完全面向对象的。
在网页中,可以使用属性、方法和事件来处理HTML元素。
页框架为响应在服务器上运行的代码中的客户端事件提供统一的模型,从而使您不必考虑基于Web的应用程序中固有的客户端和服务器隔离的实现细节。
该框架还会在页处理生命周期中自动维护页及该页上控件的状态。
使用页和控件框架还可以将常用的UI功能封装成易于使用且可重用的控件。
控件只需编写一次,即可用于许多页并集成到网页中。
这些控件在呈现期间放入网页中。
页和控件框架还提供各种功能,以便可以通过主题和外观来控制网站的整体外观和感觉。
可以先定义主题和外观,然后在页面级或控件级应用这些主题和外观。
ASP NET 2.0网页和Web控件-外文翻译
![ASP NET 2.0网页和Web控件-外文翻译](https://img.taocdn.com/s3/m/42793772561252d380eb6eac.png)
外文翻译毕业设计题目:基于的物业管理系统开发原文1: 2.0 Web Pagesand Web Controls译文1: 2.0 网页和Web控件原文2:The Role of Global.asax File 译文2:Global.asax文件的作用原文1 2.0 Web Pages and Web Controls U ntil now, all of the example applications in this text have focused on console-based and Windows Forms front ends. In this chapter and the next, you’ll explore how the .NET platform facilitates the construction of browser-based presentation layers. To begin, you’ll quickly review a number of key web-centric concepts (HTTP, HTML, client-side, and server-side script) and the role of the web server (including the development server, WebDev.WebServer.exe).With this web primer out of the way, the remainder of this chapter concentrates on the composition of (including the enhanced code-behind model) and how to work with web controls. As you will see, 2.0 provides a number of new web controls, a new “master page”model, and various customization techniques.The Role of HTTPWeb applications are very different animals from traditional desktop applications (to say the least).The first obvious difference is that a production-level web application will always involve at least two networked machines (of course, during development it is entirely possible to have a single machine play the role of both client and server). Given this fact, the machines in question must agree upon a particular wire protocol to determine how to send and receive data. The wire protocol that connects the computers in question is the Hypertext Transfer Protocol (HTTP).When a client machine launches a web browser (such as Netscape Navigator, Mozilla Firefox,or Microsoft Internet Explorer), an HTTP request is made to access a particular resource (such as an *.aspx or *.htm file) on the remote server machine. HTTP is a text-based protocol that is built upon a standard request/response paradigm. For example, if you navigate to www. , the browser software leverages a web technology termed Domain Name Service (DNS) that converts the registered URL into a four-part, 32-bit numerical value (aka an IP address). At this point, the browser opens a socket connection (typically via port 80) and sends the HTTP request for the default page at the website.Once the hosting web server receives the incoming HTTP request, the specified resource may contain logic that scrapes out any client-supplied input values (such as values within a text box) in order to format a proper HTTP response. Web programmers may leverage any number of technologies (CGI, ASP, , Java servlets, etc.) to dynamically generate the content to be emitted into theHTTP response. At this point, the client-side browser renders the HTML emitted from the web server.Another aspect of web development that is markedly different from traditional desktop programming is the fact that HTTP is an essentially stateless wire protocol. As soon as the web server emits a response to the client, everything about the previous interaction is forgotten. Therefore, as a web developer, it is up to you take specific steps to “remember” information (such as items in a shopping cart) about the clients who are currently logged on to your site. As you will see in the next chapter, provides numerous ways to handle state, many of which are commonplace to any web platform (session variables, cookies, and application variables) as well as some new techniques (view state, control state, and the cache).Understanding Web Applications and Web ServersA web application can be understood as a collection of files (*.htm, *.asp, *.aspx, image files, etc.) and related components (such as a .NET code library) stored within a particular set of directories on a given web server. As shown in Chapter 24, web applications have a specific life cycle and provide numerous events (such as initial startup or final shutdown) that you can hook into.A web server is a software product in charge of hosting your web applications, and it typically provides a number of related services such as integrated security, File Transfer Protocol (FTP) support, mail exchange services, and so forth. Internet Information Server (IIS) is Microsoft’s enterprise-level web server product, and as you would guess, it has intrinsic support for classic ASP as well as web applications.When you build web applications, you will often need to interact with IIS. Be aware, however, that IIS is not automatically selected when you install the Windows Server 2003 or Windows XP Professional Edition (you can’t install IIS on the Home editions of Windows). Therefore, depend ing on the configuration of your development machine, you may be required to manually install IIS before proceeding through this chapter. To do so, simply access the Add/Remove Program applet from the Control Panel folder and select Add/Remove Windows Components.Working with IIS Virtual DirectoriesA single IIS installation is able to host numerous web applications, each of which resides in a virtual directory. Each virtual directory is mapped to a physical directory on the local hard drive. Therefore,if you create a new virtual directory named CarsRUs, the outside world can navigate to this site using a URL such as (assuming your site’s IP address has been registeredwith the world at large). Under the hood, the virtual directory maps to a physical root directory such as C:\inetpub\wwwroot\AspNetCarsSite, which contains the content of the web application.When you create web applications using Visual Studio 2005, you have the option of generating a new virtual directory for the current website. However, you are also able to manually create a virtual directory by hand. For the sake of illustration, assume you wish to create a simple web application named Cars. The first step is to create a new folder on your machine to hold the collection of files that constitute this new site (e.g., C:\CodeTests\CarsWebSite).Next, you need to create a new virtual directory to host the Cars site. Simply right-click the Default Web Site node of IIS and select New ➤Virtual Directory from the context menu. This menu selection launches an integrated wizard. Skip past the welcome screen and give your website a name (Cars). Next, you are asked to specify the physical folder on your hard drive that contains the various files and images that represent this site (in this case, C:\CodeTests\CarsWebSite).The final step of the wizard prompts you for some basic traits about your new virtual directory (such as read/write access to the files it contains, the ability to view these files from a web browser, the ability to launch executables [e.g., CGI applications], etc.). For this example, the default selections are just fine (be aware that you can always modify your selections after running this tool using variousright-click Property dialog boxes integrated within IIS).译文1作者:迪诺·弗雷国籍:美国出处: 2.0 and Data-Bound Controls 2.0网页和Web控件到现在为止,本书的示例应用程序主要集中在控制台和基于Windows窗体前端。
asp网站毕业设计英文文献
![asp网站毕业设计英文文献](https://img.taocdn.com/s3/m/b00f220f0b4e767f5acfce5e.png)
Making an Web Site AccessibleScott MitchellMay 2004Summary: Take advantage of inheritance in the .NET Framework to extend classes to make them generate code that is fully accessible to people with disabilities. (13 printed pages) IntroductionWhile the majority of online users are able to browse Web sites using Web browsers with the typical browser settings, users with disabilities commonly use alternative means to access online information. For example, a blind user might use a text-only browser that converts the text into Braille, or reads the text aloud using a screen reader. A person with reduced vision might still use a browser like Microsoft® Internet Explorer, but with a screen magnifier, or with the browser configured to use extra large font sizes. Motor disabilities might preclude a user from using the mouse or keyboard as an input device.Since people with disabilities typically surf the Web using special devices or non-standard browser configurations, a Web site's overall design and HTML markup greatly impacts the disabled person's user experience. For example, specifying font sizes using absolute measurements—like 10pt—displays the font in that absolute size, and not relative to the text size the user has configured in his browser. Sites that have a Flash or Shockwave interface, and do not provide an alternate, text representation, effectively cut off users with Braille devices or text-to-speech synthesizers. A Web site is said to be accessible if it is designed to transition gracefully to alternate devices.At this point, you might be thinking, "Why should I bother ensuring my Web site is accessible?" There are two good reasons I can think of:1.It's Good Business – According to the U.S. Census 2000, 49.7 million Americans have a disability; a June 2000 poll by Harris Interactive shows that 43% of disabled Americans are regular online users, and that users with disabilities spend almost twice as much time online than users without disabilities. Put the results of these two surveys together and you'll find that there are more than 21 million Americans with disabilities who are regularly online. By not taking the time to make your Web site accessible, you are cutting off 21 million potential visitors.2. It's a Mandate for Government Agencies – In 1998 the United State government passed Section 508 of the Rehabilitation Act, requiring Federal agencies to make their electronic information accessible to individuals with disabilities. This law provides accessibility guidelines for software applications and Web applications, as well as telecommunication products and video products. Not only are Federal agencies required to implement accessibility guidelines, but also private companies that are contracted to work for the Federal government. (A number of countries outside the U.S. also have similar accessibility requirements for government agencies.) Therefore, creating accessible Web applications is required if you work for the government or for a company that provides services to the government.In this article we will discuss what steps you can take to ensure that your Microsoft® Web site is accessible. We'll take a brief look at the official accessibility guidelines available today, and then focus in on the accessibility guidelines used by the United States government. The article wraps up with a look at how to use inheritance to turn non-accessible Web controls into ones that meet accessibility guidelines.The WAI, WCAG, and Section 508There are a number of steps that can be taken to make a Web site more accessible. But what, exactly, are these steps, and how many of them does one site need to employ in order to be considered accessible? The answers to these questions differ based on who you ask, and what level of accessibility they need to provide. An intranet site for a Fortune 500 company would likely require a higher degree of accessibility than an intranet site for a company with only 25 employees.The WC3's Say on AccessibilityTo help formalize this discussion, in 1999 the WC3 officially founded the Web Accessibility Initiative (WAI), a group tasked with improving Web site usability for people with disabilities. The WAI's first act was to publish the Web Content Accessibility Guidelines, or WCAG. The WCAG provides a list of 14 guidelines for accessible Web site design. The guidelines themselves do not spell out actions to take to make a Web site more accessible. Rather, they are high-level statements that provide comment on how to ensure accessibility. For example, guideline 1 is "Provide equivalent alternatives to auditory and visual content." Accompanying each guideline is a set of checkpoints. The checkpoints spell out actions that can be taken to ensure that the accessibility guideline is met. Each checkpoint is given one of the following priority values:• Priority 1 – a Web developer must satisfy this checkpoint, otherwise one or more groups of users will not be able to access the content.• Priority 2 – a Web developer should satisfy this checkpoint, otherwise one or more groups of users will find it difficult to access the content.• Priority 3 –a Web developer may address this checkpoint, otherwise one or more groups of users might have difficulty when accessing the content.In addition to listing the 14 guidelines and their associated, prioritized checkpoints, the WCAG alsoprovides a three-level classification scale for Web site accessibility. Sites that implement all Priority 1 checkpoints are rated at conformance level A. Those that implement all Priority 1 and Priority 2 checkpoints are rated Double-A, while those that implement all of the checkpoints are rated Triple-A. The WCAG gives a good set of actions to perform to ensure varying levels of accessibility.Although a thorough discussion of the WCAG is beyond the scope of this article, listed below are the 14 high-level guidelines of the WCAG. The checkpoints for each guideline, and their associated priority, can be found at the official Web Content Accessibility Guidelines 1.0 specification.15. Provide equivalent alternatives to auditory and visual content16. Don't rely on color alone17. Use markup and style sheets and do so properly18. Clarify natural language use19. Create tables that transform gracefully20. Ensure that pages featuring new technologies transform gracefully21. Ensure user control of time-sensitive content changes22. Ensure direct accessibility of embedded user interfaces23. Design for device-independence24. Use interim solutions25. Use W3C technologies and guidelines26. Provide context and orientation information27. Provide clear navigation mechanisms28. Ensure that documents are clear and simpleMicrosoft's Accessible Web Controls for 1.x.Many of the WCAG checkpoints and Section 508 rules dictate specific HTML markup that should be used to make a Web site more accessible. For example, checkpoint 5.1 in the WCAG (a Priority 1 checkpoint) and rule (g) in Section 508 requires that <table> elements properly identify row and column headers. That is, the <td> element must be used to identify data cells, whereas <th> must be used to identify headers.When building Web sites, developers rarely have to worry about generating HTML markup. Rather, Web controls are used that emit the proper markup. Unfortunately, many of the Web controls emit markup that violates the accessibility rules outlined by the WCAG and Section 508. Since all Web controls are, fundamentally, classes in the Microsoft® .NET Framework, their functionality can be extended in a number of ways to conform to accessibility guidelines.A prime example of enhancing an existing Web control to meet accessibility guidelines can be seen with the DataGrid Web control. The DataGrid Web control that ships with the .NET Framework does not conform to rule (g) in Section 508 / checkpoint 5.1 in the WCAG. That is, the headers are rendered using <td> elements instead of <th>. (To see what I mean, check out this live demo, and do a View/Source in your browser. You'll see that the header row uses <td>s rather than <th>s.) However, in June 2003 Microsoft releasedan Hotfix Rollup Package that, among other things, includes an improved version of the DataGrid, one that conforms to rule (g) in Section 508.Note The Hotfix Rollup Package provides other accessibility-related enhancements. For example, it adds an optional AssociatedControlID property to the Label Web control to specify the ID of the Web control the Label is associated with. If this property is provided, the Label is rendered as a <label> HTML element with the for attribute referencing the specified Web control. For more information consult this knowledge base article.Creating An Adaptive, Accessible DataGrid Web ControlThe Web controls provided in the June 2003 Hotfix bring the Web controls up to Section 508 standards. Even with the Hotfix, however, there are still a number of WCAG Priority 1 checkpoints not being met. Fortunately you can easily extend the functionality of existing Web controls to conform to the accessibility guidelines required by your company. This is possible thanks to the power of inheritance. Specifically, we can take a Web control that does not conform to the accessibility standards, and create an extended Web control that does conform to the standards. By using inheritance, we only have to change or add the functionality to make the control conforming to the standards, and do not have to rewrite the base functionality.WCAG Checkpoint 6.3 reads: "Ensure that pages are usable when scripts, applets, or other programmatic objects are turned off or not supported. If this is not possible, provide equivalent information on an alternative accessible page. For example, ensure that links that trigger scripts work when scripts are turned off or not supported (for example, do not use "javascript:" as the link target)." However, the LinkButton Web control is rendered as a hyperlink with a javascript: link target (<a href="javascript:__doPostBack('...','...')">...</a>). The problem is that browsers that don't support JavaScript won't be able to postback the Web page by clicking on the LinkButton. This renders sortable DataGrids unsortable in browsers that don't support JavaScript since the column headers are rendered as LinkButtons.The remainder of this article looks at building a set of adaptive custom DataGrid columns that will display a Button Web control in the header of a sortable DataGrid if it is visited by a browser that doesn't support JavaScript. The Button Web control works for browsers that do not support JavaScript since it renders a <input type="submit"> tag rather than a hyperlink with a javascript: link target.Note Section 508 does not require that links not use the javascript: link target. Section 508's sole comment on client-side script can be found in rule (l), which reads: "pages utilize scripting languages to display content, or to create interface elements, the information provided by the script shall be identified with functional text that can be read by assistive technology." What this rule requires is that if content is generated by script, or if a page's behavior is modified via script, that a <noscript> HTML element be used with an explanation of the script behavior. Regardless, I have heard from several developers working on government projects that required them to support browsers without JavaScript functionality.Making DataGridColumn AdaptiveThe DataGrid Web control is comprised of a number of columns, which are classes that derive from the System.Web.UI.WebControls.DataGridColumn class. ships with five built-in DataGrid column types:1. BoundColumn2. ButtonColumn3. EditCommandColumn4. HyperLinkColumn5. TemplateColumnThe base class, DataGridColumn, provides the properties and methods inherent to all DataGrid column types. These include properties like HeaderText, SortExpression, Visible, and others. The DataGridColumn class has two methods that play an important role in creating a DataGrid: •Initialize() –initializes the DataGridColumn. Called once per column during the DataGrid's databinding process.•InitializeCell(cell, index, itemType) – called for each cell that is created during for each column during the DataGrid's databinding process. Cell is a TableCell object representing the actual HTML <table> cell for the cell being initializes; index is the row index of the cell being initialized; itemType is value from the ListItemType enumeration, specifying what type of cell is being added (Item, AlternatingItem, Header, Footer, EditItem, and so on.The DataGridColumn class is responsible for rendering the header and footer for the column. The derived classes –BoundColumn, ButtonColumn, EditCommandColumn, etc. –are responsible for rendering the DataGrid items.Note For more information on creating custom DataGrid columns, check out Marcie Robillard's article Creating Custom Columns for the DataGrid.To have our DataGrid adaptively render the header based on whether or not the user's browser supports JavaScript, we need to create a custom DataGrid class that is derived from DataGridColumn. This custom DataGrid column class, named AccessibleDataGridColumn, will need to override the DataGridColumn class's InitializeCell() method, checking to see if the DataGrid is configured for sorting and being visited by a browser that doesn't support JavaScript. If these two conditions are true, then AccessibleDataGridColumn will render a Button in the header as opposed to a LinkButton. The code for this class is shown below:Public Class AccessibleDataGridColumnInherits DataGridColumnPublic Overrides Sub InitializeCell( _ByVal cell As TableCell, _ByVal columnIndex As Integer, _ByVal itemType As ListItemType)Dim sorting As Boolean = _Not Me.Owner Is Nothing _AndAlso Me.Owner.AllowSorting _AndAlso Me.SortExpression.Length > 0Dim supportsJS As Boolean = _Not HttpContext.Current Is Nothing _AndAlso HttpContext.Current.Request.Browser.JavaScriptIf sorting And Not supportsJS _And itemType = ListItemType.Header And Not Me.DesignMode _Then If Me.HeaderImageUrl.Length > 0 ThenDim b As New ImageButtonb.AlternateText = Me.HeaderTextb.ImageUrl = Me.HeaderImageUrlmandName = "Sort"mandArgument = Me.SortExpressionb.CausesValidation = False cell.Controls.Add(b)ElseDim b As New Buttonb.Text = Me.HeaderTextmandName = "Sort"mandArgument = Me.SortExpressionb.CausesValidation = Falsecell.Controls.Add(b)End IfElse MyBase.InitializeCell(cell, columnIndex, itemType)End IfEnd SubEnd ClassThe overridden InitializeCell() method checks to see if sorting is enabled, if the current browser does not support client-side JavaScript, if the current item being initialized is a header, and if the rendering is not being performed in Microsoft® Visual Studio® .NET's designer. If this check passes, then another check is performed to determine if the column has a HeaderImageUrl value specified. If it does, it renders an ImageButton, setting its AlternateText to the column's HeaderText. If there is no HeaderImageUrl specified, a Button is created and added to the cell.Note Notice that the check to see whether or not a browser supports JavaScript simply looks up Request.Browser.JavaScript property. This property is set based on the User-Agent string sent by thebrowser to the Web server. The adaptive DataGrid will render Buttons in the header for a sortable DataGrid when someone visits with a browser that is known not to support JavaScript, such as Netscape 1.0, or Lynx. If someone visits with Microsoft® Internet Explorer 6.0 it will render the default LinkButtons, even if the visitor has manually turned off JavaScript support.Using the Accessible DataGrid Column Classes in an Web PageThis article's download includes two Microsoft® Visual Studio® .NET 2003 projects (both Visual Basic .NET projects): the first is a class library that contains the custom DataGrid column classes; the second is an Web application that you can use to test out the adaptive, accessible DataGrid column classes.To use these custom DataGrid column classes in an Web project you need to first add the compiled assembly of the custom DataGrid column classes to the Web project's /bin folder. (If you are using Visual Studio .NET, the simplest way to do this is to add the assembly to the References folder in the Solution Explorer.) Next, you need to add a @References directive at the top of the Web pages that will utilize these DataGrid columns like so:<%@ Register TagPrefix="accessibility" Namespace="AccessibilityControls" Assembly="AccessibilityControls" %>Finally, to use the columns, add a DataGrid to the Web page and set the AutoGenerateColumns property to False. In the HTML portion, add the following syntax:<asp:DataGrid runat="server" AutoGenerateColumns="False" ...> <Columns> <accessibility:AccessibleBoundColumn DataField="FieldName" ...> </accessibility:AccessibleBoundColumn> ... </Columns></asp:DataGrid>That's all there is to it! Figure 3 shows a screenshot of the HTML portion of an Web page that uses the AccessibleBoundColumn and AccessibleButtonColumn DataGrid column classes. Figure 4 shows a screenshot of the design view of that same page.Figure 3. Using the AccessibleBoundColumnFigure 4. AccessibleBoundColumn in the designerNotice that in the Visual Studio .NET Designer the DataGrid with the custom, accessible columns appears just like normal. Too, if you view the page through a browser that supports JavaScript (as Figure 5 shows), the DataGrid will be rendered as it normally is, with LinkButtons in the column headers and ButtonColumn. However, if you visit the page with a browser that doesn't support JavaScript, such as Netscape 1.0, the ButtonColumn and column headers will be rendered as Buttons (see Figure 6).Figure 5. AccessibleBoundColumn in up-level browserFigure 6. AccessibleBoundColumn in older browserAccessibility in WhidbeyThe server controls that ship in the next version of , codenamed Whidbey, will automatically generate Section 508-compliant markup by default. Furthermore, these server controls will emit WCAG-compliant markup as well. To top it off, Microsoft® Visual Studio® .NET 2005 will ship with an add-in to automatically check HTML markup for Section 508 and WCAG-compliance. For more information on these exciting additions, check out XHTML and Accessibility in Whidbey, a blog post from Scott Guthrie, co-founder of the team at Microsoft.For more information about Web site accessibility, be sure to check out Microsoft's Accessibility home page. There's also a Section 508 page as well, with resources on how various Microsoft products meet Section 508 standards.Related Books• Data Web Controls Kick Start• Unleashed•Web Accessibility for People with Disabilities•Accessibility for Everybody: Understanding the Section 508 Accessibility Requirements使一个 网站容易接近和理解①作者:Scott Mitchell②出版时间:May 2004摘要: 利用类的可继承性使得它们的代码可以被那些没有能力的人用和理解。
asp.net外文文献+翻译
![asp.net外文文献+翻译](https://img.taocdn.com/s3/m/923f3e6e1ed9ad51f01df217.png)
技术1.构建 页面 和结构 是微软.NET framework整体的一部分, 它包含一组大量的编程用的类,满足各种编程需要。
在下列的二个部分中, 你如何学会 很适合的放在.NET framework, 和学会能在你的 页面中使用语言。
.NET类库假想你是微软。
假想你必须支持大量的编程语言-比如Visual Basic 、C# 和C++. 这些编程语言的很多功能具有重叠性。
举例来说,对于每一种语言,你必须包括存取文件系统、与数据库协同工作和操作字符串的方法。
此外,这些语言包含相似的编程构造。
每种语言,举例来说,都能够使用循环语句和条件语句。
即使用Visual Basic 写的条件语句的语法不与用C++ 写的不一样,程序的功能也是相同的。
最后,大多数的编程语言有相似的数据变量类型。
以大多数的语言,你有设定字符串类型和整型数据类型的方法。
举例来说,整型数据最大值和最小值可能依赖语言的种类,但是基本的数据类型是相同的。
对于多种语言来说维持这一功能需要很大的工作量。
为什么继续再创轮子? 对所有的语言创建这种功能一次,然后把这个功能用在每一种语言中岂不是更容易。
.NET类库不完全是那样。
它含有大量的满足编程需要的类。
举例来说,.NET类库包含处理数据库访问的类和文件协同工作,操作文本和生成图像。
除此之外,它包含更多特殊的类用在正则表达式和处理Web协议。
.NET framework,此外包含支持所有的基本变量数据类型的类,比如:字符串、整型、字节型、字符型和数组。
最重要地, 写这一本书的目的, .NET类库包含构建的 页面的类。
然而你需要了解当你构建.NET页面的时候能够访问.NET framework 的任意类。
理解命名空间正如你猜测的, .NET framework是庞大的。
它包含数以千计的类(超过3,400) 。
幸运地,类不是简单的堆在一起。
.NET framework的类被组织成有层次结构的命名空间。
【毕业设计】文献翻译 原文译文(探究ASP-NET-MVC请求的生命周期)
![【毕业设计】文献翻译 原文译文(探究ASP-NET-MVC请求的生命周期)](https://img.taocdn.com/s3/m/6b242d10e87101f69e31957c.png)
MVC In-Depth: The Life of an MVC Request The purpose of this blog entry is to describe, in painful detail, each step in the life of an MVC request from birth to death. I want to understand everything that happens when you type a URL in a browser and hit the enter key when requesting a page from an MVC website.Why do I care? There are two reasons. First, one of the promises of MVC is that it will b e a very extensible framework. For example, you’ll be able to plug in different view engines to control how your website content is rendered. You also will be able to manipulate how controllers get generated and assigned to particular requests. I want to walk through the steps involved in an MVC page request because I want to discover any and all of these extensibility points.Second, I’m interested in Test-Driven Development. In order to write unit tests for controllers, I need to understand all of the controller dependencies. When writing my tests, I need to mock certain objects using a mocking framework such as Typemock Isolator or Rhino Mocks. If I don’t understand the page request lifecycle, I won’t be able to effectively mock it.Two WarningsB ut first, two warnings.Here's the first warning: I’m writing this blog entry a week after the MVC Preview 2 was publicly released. The MVC framework is still very much in Beta. Therefore, anything that I describe in this blog entry might be outdated and, therefore, wrong in a couple of months. So, if you are reading this blog entry after May 2008, don’t believe everything you read.Second, this blog entry is not meant as an overview of MVC. I describe the lifecycle of an MVC request in excruciating and difficult to read detail. Okay, you have been warned.Overview of the Lifecycle StepsThere are five main steps that happen when you make a request from an MVC website:Step 1 : The RouteTable is CreatedWhen you request a page from a normal application, there is a page on disk that corresponds to each page request. For example, if you request a page named SomePage.aspx then there better be a page named SomePage.aspx sitting on your web server. If not, you receive an error.Technically, an page represents a class. And, not just any class. An page is a handler. In other words, an page implements the IHttpHandler interface and has a ProcessRequest() method that gets called when you request the page. The ProcessRequest() method is responsible for generating the content that gets sent back to the browser.So, the way that a normal application works is simple and intuitive. You request a page, the page request corresponds to a page on disk, the page executes its ProcessRequest() method and content gets sent back to the browser.An MVC application does not work like this. When you request a page from an MVC application, there is no page on disk that corresponds tothe request. Instead, the request is routed to a special class called a controller. The controller is responsible for generating the content that gets sent back to the browser. When you write a normal application, you build a bunch of pages. There is always a one-to-one mapping between URLs and pages. Corresponding to each page request, there better be a page.When you build an MVC application, in contrast, you build a bunch of controllers. The advantage of using controllers is that you can have a many-to-one mapping between URLs and pages. For example, all of the following URLs can be mapped to the same controller:The single controller mapped to these URLs can display product information for the right product by extracting the product Id from the URL. The controller approach is more flexible than the classic approach. The controller approach also results in more readable and intuitive URLs.So, how does a particular page request get routed to a particular controller? An MVC application has something called a Route Table. The Route Table maps particular URLs to particular controllers.An application has one and only one Route Table. This Route Table is setup in the Global.asax file. Listing 1 contains the default Global.asax file that you get when you create a new MVC Web Application project by using Visual Studio.An application’s Route Table is represented by the static RouteTable.Routes property. This property represents a collection of Route objects. In the Global.asax file in Listing 1, two Route objects are added to the Route Table when the application first starts (The Application_Start() method is called only once when the very first page is requested from a website).A Route object is responsible for mapping URLs to handlers. In Listing 1, two Route objects are created. Both Route objects map URLs to the MvcRouteHandler. The first Route maps any URL that follows the pattern {controller}/{action}/{id} to the MvcRouteHandler. The second Route maps the particular URL Default.aspx to the MvcRouteHandler.By the way, this new routing infrastructure can be used independently of an MVC application. The Global.asax file maps URLs to the MvcRouteHandler. However, you have the option of routing URLs to a different type of handler. The routing infrastructure described in this section is contained in a distinct assembly named System.Web.Routing.dll. You can use the routing without using the MVC.Step 2 : The UrlRoutingModule Intercepts the RequestWhenever you make a request against an MVC application, the request is intercepted by the UrlRoutingModule HTTP Module. An HTTP Module is a special type of class that participates in each and every page request. For example, classic includes a FormsAuthenticationModule HTTP Module that is used to implement page access security using Forms Authentication.When the UrlRoutingModule intercepts a request, the first thing the module does is to wrap up the current HttpContext in an HttpContextWrapper2 object. The HttpContextWrapper2 class, unlike the normal HttpContext class, derives from theHttpContextBase class. Creating a wrapper for HttpContext makes it easier to mock the class when you are using a Mock Object Framework such as Typemock Isolator or Rhino Mocks.Next, the module passes the wrapped HttpContext to the RouteTable that was setup in the previous step. The HttpContext includes the URL, form parameters, query string parameters, and cookies associated with the current request. If a match can be made between the current request and one of the Route objects in the Route Table, then a RouteData object is returned.If the UrlRoutingModule successfully retrieves a RouteData object then the module next creates a RouteContext object that represents the current HttpContext and RouteData. The module then instantiates a new HttpHandler based on the RouteTable and passes the RouteContext to the new handler’s constructor.In the case of an MVC application, the handler returned from the RouteTable will always be an MvcHandler. Whenever the UrlRoutingModule can match the current request against a Route in the Route Table, an MvcHandler is instantiated with the current RouteContext.The last step that the module performs is setting the MvcHandler as the current HTTP Handler. An application calls the ProcessRequest() method automatically on the current HTTP Handler which leads us to the next step.Step 3 : The MvcHandler ExecutesIn the previous step, an MvcHandler that represents a particular RouteContext was set as the current HTTP Handler. An application always fires off a certain series of events including Start, BeginRequest, PostResolveRequestCache, PostMapRequestHandler, PreRequestHandlerExecute, and EndRequest events (there are a lot of application events – for a complete list, lookup the HttpApplication class in the Microsoft Visual Studio 2008 Documentation).Everything described in the previous section happens during the PostResolveRequestCache and PostMapRequestHandler events. The ProcessRequest() method is called on the current HTTP Handler right after the PreRequestHandlerExecute event.When ProcessRequest() is called on the MvcHandler object created in the previous section, a new controller is created. The controller is created from a ControllerFactory. This is an extensibility point since you can create your own ControllerFactory. The default ControllerFactory is named, appropriately enough, DefaultControllerFactory.The RequestContext and the name of the controller are passed to the ControllerFactory.CreateController() method to get a particular controller. Next, a ControllerContext object is constructed from the RequestContext and the controller. Finally, the Execute() method is called on the controller class. The ControllerContext is passed to the Execute() method when the Execute() method is called.Step 4 : The Controller ExecutesThe Execute() method starts by creating the TempData object (called the Flash object in the Ruby on Rails world). The TempData can be used to store temporary data that must be used with the very next request (TempData is like Session State with no long-term memory).Next, the Execute() method builds a list of parameters from the request. These parameters, extracted from the request parameters, will act as method parameters. The parameters will be passed to whatever controller method gets executed.The Execute() method finds a method of the controller to execute by using reflection on the controller class (.NET reflection and not navel gazing reflection). The controller class is something that you wrote. So the Execute() method finds one of the methods that you wrote for your controller class and executes it. The Execute() method will not execute any controller methods that are decorated with the NonAction attribute.At this point in the lifecycle, we’ve entered your application code.Step 5 : The RenderView Method is CalledNormally, your controller methods end with a call to either the RenderView() or RedirectToAction() method. The RenderView() method is responsible for rendering a view (a page) to the browser.When you call a controller’s RenderView() method, the call is delegated to the current ViewEngine’s RenderView() method. The ViewEngine is another extensibility point. The default ViewEngine is the WebFormViewEngine. However, you can use another ViewEngine such as the NHaml ViewEngine.The WebFormViewEngine.RenderView() method uses a class named the ViewLocator class to find the view. Next, it uses a BuildManager to create an instance of a ViewPage class from its path. Next, if the page has a master page, the location of the master page is set (again, using the ViewLocator class). If the page has ViewData, the ViewData is set. Finally, the RenderView() method is called on the ViewPage.The ViewPage class derives from the base System.Web.UI.Page class. This is the same class that is used for pages in classic . The final action that RenderView() method performs is to call ProcessRequest() on the page class. Calling ProcessRequest() generates content from the view in the same way that content is generated from a normal page.SummaryThe goal of this blog entry was to describe the entire life of an MVC request from birth to death. I examined the five steps involved in processing an MVC request: Creating the RouteTable, Intercepting the request with the UrlRoutingModule, Generating a Controller, Executing an Action, and Rendering a View.探究 MVC: MVC请求的生命周期本书详细描述了 MVC请求从开始到结束的整个过程,当你在浏览器上输入URL地址并且在网站请求页面敲击回车时,这个过程就产生了。
外文翻译--ASP. NET 中认证安全特征评述
![外文翻译--ASP. NET 中认证安全特征评述](https://img.taocdn.com/s3/m/bdba11dbbd64783e08122b0f.png)
南京邮电大学通达学院毕业设计(论文)外文资料翻译学院:通达学院专业:网络工程学生姓名:班级学号:外文出处: Simulation of Time-Varying, Frequency-Selective Multipath Fading Channels forSpread-Spectrum Waveforms附件:1.外文资料翻译译文;2.外文原文附件1:外文资料翻译译文ASP. NET 中认证安全特征评述Narcisio Tumushabe ,谭冠正(音译)(中南大学计算机科学与信息技术学院, 湖南长沙410083)摘要:一个适用于任意的扩频信道模拟器传输任意随时间变化的波形,频率选择性多径瑞利衰落渠道的开发和实施。
都多普勒(或时间)的多样性和延迟(或频率)多样性被认为是在信道模型的siinuhtor是根据。
的信道被假定为是一个随时间变化的服从不相关的高斯信道,散射的假设。
模型由多个多普勒频移的分支抽头延迟线。
没有假设是由独立的通道水龙头。
仿真结果为平坦慢衰落,平快衰落,频率选择性慢衰落和频率选择快衰落的例子给出。
1 介绍多径衰落的一种现象,介绍了信号通过在多个所引起的失真的干扰传播路径上的通信信道。
很好一种时变多径衰落信道的例子是移动无线通信信道。
在移动无线电信道,多径传播时发生的信号从周围的物体反射,和相对运动发射机和接收机之间的介绍在通道中,表现为随时间的变化多普勒展宽谱中的多径组件。
模拟多径的最准确的方法衰落信道的使用实际记录的条宽带信道测量。
然而,由于系统性能分析的复杂性记录的数据,从理论上推导了信道模拟器原则是感兴趣的,特别是用于系统性能评价[我]。
最常见的统计研究人员使用的信道模型是广义的固定不相关的散射(WSSUS)模型贝洛[ 2 ]。
先前设计[模拟器,3-81主要是定制的WSSUS信道的特殊类型。
在本文中开发的模拟器进行了改进在几个方面。
首先,它是一个通用的信道模拟器具有对信道衰落的选择没有限制参数。
计算机专业毕业设计科技文献翻译
![计算机专业毕业设计科技文献翻译](https://img.taocdn.com/s3/m/3d5b1d29783e0912a2162aba.png)
信息学院毕业设计科技文献翻译《 Technique》《技术》姓名博文专业计算机科学与技术学号 1班级计算机科学与技术01班指导教师乃丽2015年 3月 TechniqueAnd not only being Active Server Page (ASP) next edition, be that a kind of builds the procedure truss on General Purpose Language , can be used to build Web application big and powerful coming one Web server. provides a lot of bigger and powerful than Web now exploitation pattern advantage.Carry out wide efficiency rise is that General Purpose Language-based procedure is run on the server. Carry out compiling , carry out effect , certainly compete with each other in a bar like this when working first unlike that before ASP explaining procedure immediately, but being that procedure is held in the server make an explanation strong many.The world-level implement holds outThe truss is to be able to use up to the minute product of Microsoft (R) company Visual exploitation environment to carry out exploitation , WYSIWYG (what What You See Is What You Get is gains) editor. These are only strong-rization one fraction of software support.Big and powerful and adaptabilityIts big and powerful and adaptability compiling and translating working procedure , reason why because of is General Purpose Language-based, on being able to make it run 2000 Server applying the upper (author of nearly all platform of software developer to Web knowing it can only use in Windows up to now only). General Purpose Language fundamental warehouse , information mechanism, data interface treatment all can have no integrating sewing applying middle to the Web. is also that language-independent language melts on one's own at the same time, reason why, you can choose one kind of the procedure beingfit to compile and compose you coming your language most , your procedure is written or coming using very various language, (the association having C # C + + and Java) , VB , Jscript already holding out now. Such various program language associate ability protects your COM + exploitation-based procedure now in the future, the transplanting being able to entirely faces .Simplicity and easy to learn is that dignity verifies , the distribution system and website allocation become very simple run a few very common missions submit customer whole course of if the form is single. That the for example page of face truss allows you to found your own consumer interface, makes the person be unlike the common VB-Like interface. Besides, that General Purpose Language facilitates exploitation makes to become simple accommodating oneself to of software combining with a code like assembling a computer.High-effect but administrationThat uses one kind of character basis's , classification's deploys system , makes your server environment and the application interposition especially simple. Because of allocation information all preserves in simple version , new interposition has an implement to may all do not need to start local administrative person can come true. That this is called "Zero Local Administration philosophy concept makes because of applicative exploitation more concrete, and rapid. A application requires that simple copy few must get a document , not requiring that systematic again starting , everything are that such is simple in systematic installation of one server.Many processor environments reliabilityThe quilt already designs painstakingly becoming one kind of the exploitation implement being able to be used for many processor , it uses peculiar seamless the speed linking a technology , very big rise being run to sew under many processor environments. Even if that your now applies a software is to be that one processor is development many processor do not require that any changes the efficacy being able toimprove them when working, but ASP now cannot achieve indeed in the future this one point.Certainly definition, and augmentabilityWhen is designed have considered the module let website develop a personnel to be able to be hit by self definition plug-in in self code. This is different from original inclusion relation , can add self definition's how module. Website procedure exploitation has been all along not so simple.SecurityOwing to that the Windows attestation technology and every application deploying , you can be true your plain procedure is now and then absolutely safe.The grammar to a great extent with ASP compatible, it provides one kind of new programming model and structure at the same time , may generate flexibility and much better application of stability , provide the much better safeguard and. Add the function gradually in being able to pass in now available ASP application, function strengthening ASP application at any time. is that one already has compiled and translated, because of. The NET environment, runs General Purpose Language-based procedure on the server. Carry out compiling when procedure is held in the server working first, than ASP makes it snappy immediately on INTERP speed many. And be to be able to use any and. Compatible language of NET (includes Visual Basic. NET , C # and Jscript. NET.) Create application. Besides, any application all can be put into use entire. NET Framework. The personnel who develops can gain these technology merit conveniently , include the trusteeship common language running warehouse environment , type safety , inheriting and so on among them. can edit an implement seamlessly with WYSIWYG HTML and weave the Cheng implement other (including Microsoft Visual Studio. NET) works together. Page of GUI and completely integrated debugging this not only feasible Web is developed to go to the lavatory especially, and can provide all merit that these implements provide be obliged to , include Web developing a personnel to be able to be used server control drag and drop to be arrived at hold out.While establishing application, the personnel who develops can use the Web window body or XML Web services , carry out combination or with any way that they regard as rightly. That every function all can get the same architectural support, makes you be able to use dignity to verify a scheme , the data that slow exist often uses, carries out self definition on the application allocation or.2. Building PagesA 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 andintegers, 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 allthe 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 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..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) with the .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.3. 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.4. Performing Form Validation with Validation Controls Using 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 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 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 chapterto 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.5. 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 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 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.英文翻译ASP,NET技术英文作者:UNKNOWN 翻译:博文2015年4月摘要:这篇文章是关于的介绍.。
英文翻译
![英文翻译](https://img.taocdn.com/s3/m/9aa2df69561252d380eb6e4b.png)
英文原文 APPLICATION PERFORMANCEOPTIMIZATION OF RESEARSHWeb site for the performance of developers is very important. An excellent site although there are handsome page design, improve the service functions, but open the pages of a lengthy delay, users will eventually be intolerable. Especially for large-scale e-commerce sites, there are tens of thousands of users per second at the same time visit the site without good performance, can not meet the huge demand. as a whole new generation of dynamic web page generation system, its platform performance compared with the original ASP has a nature of the increase. However, on this basis to develop professional standards and in accordance with production standards, welcomed by the users of web applications, also need to develop staff from the perspective of the page programming, data access and treatment in areas such as string to optimize To enhance the site's overall performance.This paper will mainly explore in associated with several ways to optimize performance and attention to the problem.1The Appropriate Choice Of Session StateHTTP protocol is a non-state communication protocol, can not record and recognition from different client's request, but in practical applications in the system have to maintain different from the client's request for the conversation between the state information. will be adopted if state information stored in the process,the state server or SQL Server database to solve the problem.What status information will be stored in the memory of WEB server with the best performance, fast, but they do not have session state information across multiple server capacity. To WEB server in a number of conversations between the safeguarding of information, you can use the state of storage servers, in this way because applications can be deployed to multiple servers and improve the system's flexibility and reliability, but toreduce performance for the Price. For extremely important conversation, need to use the SQL Server storage, thus avoiding the loss of an important conversation, but the resulting work load is much greater than in the previous two.Without considering the status of reservations and multiple servers sharing, should be stored in the server of choice in the process, the best performance.Session state information is stored choose web.config file:<SessionStatemode = "InProc / StateServer / SqlServer" / / storage to choose this waystateConnectionString = "tcpip = 127.0.0.1:42424"……timeout = "20" />2The Server Controls Optimization2.1Server controls to reduce unnecessaryServer control and the convenience function is to control the html unprecedented. However, every server controls are necessary to create a corresponding server-side objects, at the expense of server-side at the cost of the resources, excessive use of server controls will greatly affect performance.In many cases, simply use html tags or data that is bound to achieve the required functions. For example, <asp: Label>control, the use of it to display static information, fully available to achieve a simple tag. If html controls can not be achieved by the function, but also in scripting languages such as javascript, vbscript also can not be achieved only under the circumstances considered the option of server controls.2.2Disable unnecessary state of viewThe state controls the server can automatically attribute the view of the page from the server in the course of maintaining control of the state, reduce the workload of developers, but need to use up a lot of the server memory resources. Therefore, the need for server control of the state of view, it should be EnableViewState property to false, such as the commonly used <asp: Lable> and <asp: Button> control.2.3Page.IsPostBackPage.IsPostBack used to record whether the pages from the client to return, if the initial operation that is false, or that from the client again to return to the page. Page.IsPostBack reasonable application of the pages in between can be avoided in the course of some unnecessary operation. In Page_Load function and some only need to initialize a function of the incident can be used to improve the attributes application performance.void Page_Load (Object o, EventArgs e){If (! Page.IsPostBack)conn = new SqlConnection ( "server = localhost; uid = sa; pwd =; database = data");String sql = "select * from student";Cmd.Fill (ds, "stu");MydataGrid.DataBind ();}}The code above will ensure that only the first visit to the page when the database read and binding.2.4Rational use of DataGrid controlDataGrid control with the most powerful data display, built-in changes to the data, delete, add, paging, and many other features. If the data show that only simple, DataGrid is not the best choice. DataGrid control of the paging functions, data storage (stored in the viewstate), although the developers to make the process easy to use fast, but the resulting performance should not be spending Small.DataList controls less than the DataGrid a lot of functions. However, since a lot of high definition. The unique multi-line data show that it is quite convenient. DataGrid to achieve the functions of its basic be achieved.Repeater control functions at least, but since the definition of is very strong. Asreduce a lot of functions, the performance of the server brought the minimum consumption.Therefore, the data show that in a simple list, select Repeater or DataList controls to achieve the same purpose, but also reduce the performance of the overhead.3Database Access Performance Optimization3.1Database connectivity and closedAccess database resources need to create connections, open and close the connection linking several operations. These processes necessary to exchange information with the database to verify identity through more cost server resources. provides a connection pool (Connection Pool) to improve open and close the performance of the database. The database system will connect users on the connection pool, retrieve necessary, to recover the closure of connections, waiting for the next connection request.Connection pool size is limited, if the connection pool to the maximum after calling for the creation of connection is bound to greatly affect performance. Therefore, the establishment of a database is connected only in operation when the real need to open access, closed immediately after use, so as to minimize the time to open the database connection, to avoid restrictions on the situation beyond the connection.3.2The use of stored proceduresStorage process is stored on the server of a group of pre-compiled SQL statement, similar to DOS batch file in the system. Storage process with immediate access to the database functions, information processing is extremely fast. Storage can be avoided using the process of compiling the many orders, after the implementation of a plan on the implementation of its presence in the cache, whenever the need arises simply direct call cache of binary code.In addition, the storage process in the server-side operation, independent of the procedures for amending the most important thing is that it can reduce the statement in the database in the network transmission.3.3Optimize queryADO connections in considerable consumption of resources, SQL statements in the longer run, the occupation of system resources and the longer the time. Therefore, to make full use of the SQL statement optimized to reduce the execution time. For example, the query is not included in the sub-query, such as full use of the index.4String Performance Optimization4.1The use of types of ToString methodIn connection string, the frequent use of "+" sign directly to the figures added to the string. Although this method simply can also get the right results, but because of the different types of data, the number of operations required by packing into use before they can add to the type of string. However, packing a greater impact on operating performance, because in this type of treatment, will be hosting a new distribution of a pile of objects, the value of the original copy to the newly created object.The use of types of ToString method of packing operation can be avoided, thereby improving application performance.4.2Use StringBuilder classString class object is irrevocable, the String object of the re-assignment is essentially a re-creation of a String object and a new value to the object, its method of ToString to improve the performance is not very significant.In dealing with strings, it is best to use StringBuilder class,. NET namespace is System.Text. Such is not to create a new object, but through Append, Remove, Insert, and other direct means of a string operation, with the return ToString method of operation results.Its definition and the statement as follows:int num;System.Text.StringBuilder str = new System.Text.StringBuilder (); / / create a string str.Append (num.ToString ()); / / add value numResponse.Write (str.ToString); / / display operating results Application Performance TestIn the application performance testing conducted before the application process should ensure that no mistakes, and function correctly. Specific performance test can use the following tools:Web Application Strees Tool (WAS) is Microsoft has released a free testing tool, can be downloaded from the /. It can simulate hundreds or thousands of users at the same time the web application request for a visit, the formation of traffic on the server load and thus achieve the purpose of testing, can generate an average of TTFB, TTLB average performance such as the summary report.Application Center Test (ACT) is a test tools, Visual incidental to the Enterprise Edition, Microsoft is officially supported by web application testing tools. It can directly generate charts results, features more than WAS, but do not have many clients the ability to test at the same time.Server operating systems "management tool" in the "performance" counter, the server can be monitored to understand application performance.6ConclusionThe site developers, in the preparation of the attention at the application performance issues, to develop good habits, improve application performance, can at least delay the necessary hardware upgrades, reduce the cost of site.英文翻译优化应用程序性能研究网站的性能对于程序开发人员来说非常重要。
ASP外文翻译原文
![ASP外文翻译原文](https://img.taocdn.com/s3/m/67987a2d376baf1ffc4fad6f.png)
毕业设计(论文)外文参考资料及译文译文题目:《技术》学生姓名:陈韡学号: 1205201005 专业:计算机科学与技术(专转本)所在学院:计算机工程学院指导教师:朱勇职称:教授2016年 3月 16日ASP. Net Technology——download from CSDN is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of coding. is part of the .NET Framework, and when coding applications you have access to classes in the .NET Framework. You can code your applications in any language compatible with the common language runtime (CLR), including Microsoft Visual Basic, C#, JScript .NET, and J#. These languages enable you to develop applications that benefit from the common language runtime, type safety, inheritance, and so on. includes:∙ A page and controls framework∙The compiler∙Security infrastructure∙State-management facilities∙Application configuration∙Health monitoring and performance features∙Debugging support∙An XML Web services framework∙Extensible hosting environment and application life cycle management∙An extensible designer environmentThe page and controls framework is a programming framework that runs on a Web server to dynamically produce and render Web pages. Web pages can be requested from any browser or client device, and renders markup (such as HTML) to the requesting browser. As a rule, you can use the same page for multiple browsers, because renders the appropriate markup for the browser making the request. However, you can designyour Web page to target a specific browser, such as Microsoft Internet Explorer 6, and take advantage of the features of that browser. supports mobile controls for Web-enabled devices such as cellular phones, handheld computers, and personal digital assistants (PDAs). Web pages are completely object-oriented. Within Web pages you can work with HTML elements using properties, methods, and events. The page framework removes the implementation details of the separation of client and server inherent in Web-based applications by presenting a unified model for responding to client events in code that runs at the server. The framework also automatically maintains the state of a page and the controls on that page during the page processing life cycle.The page and controls framework also enables you to encapsulate common UI functionality in easy-to-use, reusable controls. Controls are written once, can be used in many pages, and are integrated into the Web page that they are placed in during rendering.The page and controls framework also provides features to control the overall look and feel of your Web site via themes and skins. You can define themes and skins and then apply them at a page level or at a control level.In addition to themes, you can define master pages that you use to create a consistent layout for the pages in your application. A single master page defines the layout and standard behavior that you want for all the pages (or a group of pages) in your application. You can then create individual content pages that contain the page-specific content you want to display. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page.All code is compiled, which enables strong typing, performance optimizations, and early binding, among other benefits. Once the code has beencompiled, the common language runtime further compiles code to native code, providing improved performance. includes a compiler that will compile all your application components including pages and controls into an assembly that the hosting environment can then use to service user requests.In addition to the security features of .NET, provides an advanced security infrastructure for authenticating and authorizing user access as well as performing other security-related tasks. You can authenticate users using Windows authentication supplied by IIS, or you can manage authentication using your own user database using forms authentication and membership. Additionally, you can manage the authorization to the capabilities and information of your Web application using Windows groups or your own custom role database using roles. You can easily remove, add to, or replace these schemes depending upon the needs of your application. always runs with a particular Windows identity so you can secure your application using Windows capabilities such as NTFS Access Control Lists (ACLs), database permissions, and so on. For more information on the identity of , provides intrinsic state management functionality that enables you to store information between page requests, such as customer information or the contents of a shopping cart. You can save and manage application-specific, session-specific, page-specific, user-specific, and developer-defined information. This information can be independent of any controls on the page. offers distributed state facilities, which enable you to manage state information across multiple instances of the same application on one computer or on several computers. applications use a configuration system that enables you to define configuration settings for your Web server, for a Web site, or for individual applications. You can make configuration settings at the time your applications are deployed and can add or revise configuration settings at any time with minimal impact on operational Web applications and servers. configuration settings are stored in XML-based files. Because these XML files are ASCII text files, it is simple to make configuration changes to your Web applications. You can extend the configuration scheme to suit your requirements. includes features that enable you to monitor health and performance of your application. health monitoring enables reporting of key events that provide information about the health of an application and about error conditions. These events show a combination of diagnostics and monitoring characteristics and offer a high degree of flexibility in terms of what is logged and how it is logged. supports two groups of performance counters accessible to your applications:∙The system performance counter group∙The application performance counter group takes advantage of the run-time debugging infrastructure to provide cross-language and cross-computer debugging support. You can debug both managed and unmanaged objects, as well as all languages supported by the common language runtime and script languages.In addition, the page framework provides a trace mode that enables you to insert instrumentation messages into your Web pages. supports XML Web services. An XML Web service is a component containing business functionality that enables applications to exchange information across firewalls using standards like HTTP and XML messaging. XML Web services are not tied to a particular component technology or object-calling convention. As a result, programs written in any language, using any component model, and running on any operating system can access XML Web services. includes an extensible hosting environment that controls the life cycle of an application from when a user first accesses a resource (such as a page) in the application to the point at which the application is shut down. While relies on a Web server (IIS) as an application host, provides much of the hosting functionality itself. The architecture of enables you to respond to application events and create custom HTTP handlers and HTTP modules. includes enhanced support for creating designers for Web server controls for use with a visual design tool such as Visual Studio. Designers enable you to build a design-time user interface for a control, so that developers can configure your control's properties and content in the visual design tool.Introduction to the C# Language and the .NET Framework C# is an elegant and type-safe object-oriented language that enables developers to build a wide range of secure and robust applications that run on the .NET Framework. You can use C# to create traditional Windows client applications, XML Web services, distributed components, client-server applications, database applications, and much, much more. Microsoft Visual C# 2005 provides an advanced code editor, convenient user interface designers, integrated debugger, and many other tools to facilitate rapid application development based on version 2.0 of the C# language and the .NET Framework.NoteC# syntax is highly expressive, yet with less than 90 keywords, it is also simple and easy to learn. The curly-brace syntax of C# will be instantly recognizable to anyone familiar with C, C++ or Java. Developers who know any of these languages are typically able to begin working productively in C# within a very short time. C# syntax simplifies many of the complexities of C++ while providing powerful features such as nullable value types, enumerations, delegates, anonymous methods and direct memory access, which are not found in Java. C# also supports generic methods and types, which provide increased type safety and performance, and iterators, which enable implementers of collection classes to define custom iteration behaviors that are simple to use by client code.As an object-oriented language, C# supports the concepts of encapsulation, inheritance and polymorphism. All variables and methods, including the Main method, the application's entry point, are encapsulated within class definitions. A class may inherit directly from one parent class, but it may implement any number of interfaces. Methods that override virtual methods in a parent class require the override keyword as a way to avoid accidental redefinition. In C#, a struct is like a lightweight class; it is a stack-allocated type that can implement interfaces but does not support inheritance.In addition to these basic object-oriented principles, C# facilitates the development of software components through several innovative language constructs, including:∙Encapsulated method signatures called delegates, which enable type-safe event notifications.∙Properties, which serve as accessors for private member variables.∙Attributes, which provide declarative metadata about types at run time.∙Inline XML documentation comments.If you need to interact with other Windows software such as COM objects or native Win32 DLLs, you can do this in C# through a process called "Interop." Interopenables C# programs to do just about anything that a native C++ application can do. C# even supports pointers and the concept of "unsafe" code for those cases in which direct memory access is absolutely critical.The C# build process is simple compared to C and C++ and more flexible than in Java. There are no separate header files, and no requirement that methods and types be declared in a particular order. A C# source file may define any number of classes, structs, interfaces, and events.C# programs run on the .NET Framework, an integral component of Windows that includes a virtual execution system called the common language runtime (CLR) and a unified set of class libraries. The CLR is Microsoft's commercial implementation of the common language infrastructure (CLI), an international standard that is the basis for creating execution and development environments in which languages and libraries work together seamlessly.Source code written in C# is compiled into an intermediate language (IL) that conforms to the CLI specification. The IL code, along with resources such as bitmaps and strings, is stored on disk in an executable file called an assembly, typically with an extension of .exe or .dll. An assembly contains a manifest that provides information on the assembly's types, version, culture, and security requirements.When the C# program is executed, the assembly is loaded into the CLR, which might take various actions based on the information in the manifest. Then, if the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code into native machine instructions. The CLR also provides other services related to automatic garbage collection, exception handling, and resource management. Code that is executed by the CLR is sometimes referred to as "managed code," in contrast to "unmanaged code" which is compiled into native machine language that targets a specific system. The following diagram illustrates the compile-time and run time relationships of C# source code files, the base class libraries, assemblies, and the CLR.Language interoperability is a key feature of the .NET Framework. Because the IL code produced by the C# compiler conforms to the Common Type Specification (CTS), IL code generated from C# can interact with code that was generated from the .NET versions of Visual Basic, Visual C++, Visual J#, or any of more than 20 other CTS-compliant languages. A single assembly may contain multiple modules written in different .NET languages, and the types can reference each other just as if they were written in the same language.In addition to the run time services, the .NET Framework also includes an extensive library of over 4000 classes organized into namespaces that provide a wide variety of useful functionality for everything from file input and output to string manipulation to XML parsing, to Windows Forms controls. The typical C# application uses the .NET Framework class library extensively to handle common "plumbing" chores.中文一译文:技术——下载自CSDN网站 是一个统一的 Web 开发模型,它包括您使用尽可能少的代码生成企业级 Web 应用程序所必需的各种服务。
计算机科学与技术英文文献
![计算机科学与技术英文文献](https://img.taocdn.com/s3/m/dd59ebed0740be1e640e9a4d.png)
计算机科学与技术英文文献《专业英语》期末考试课程论文微软 设计应用班级:13 级信息管理与信息系统 1 班学号:2013404020114姓名:朱敦达分数:2015年 12月 25日微软 设计应用CGI 具有扩充性能和克服的问题的能力,是微软公司开发的一种新的方式开发建设规模的应用。
这就是所谓的替代 high performance 互联网服务器应用程式接口 (ISAPI) 。
代替了 housing 功能编程档案,利用 DLLs 代替了复杂的编写程序的过程,同其它软件比较 DLLs 具有很大的优势,在性能上也有所扩充。
Introduction to DevelopmentTo overcome the performance and scalability problems that CGI brings, Microsoft developed a new way for developers to build scalable applications. This high performance alternative is called the Internet Server Application Programming Interface(ISAPI). Instead of housing functionality in executable files, ISAPI uses DLLs. Using DLLs instead of executable programs has some definite performance and scalability advantagesISAPI 在功能上有所扩展,它可以向用户提出要求,使单一 ISAPI 扩展执行多种任务。
就像 CGI 的例子一样 , ISAPI 再使用时必须使用目录执行许可认证 , 或利用 DLL 下载客户端,而不是直接在服务器上使用, ISAPI 扩展通常用来处理用户的要求做出回应,这和使用 CGI 的方式非常类似。
毕业论文英文文献及翻译
![毕业论文英文文献及翻译](https://img.taocdn.com/s3/m/72d3e26ac77da26925c5b0ef.png)
英文原文 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 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..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 (and the most popular programming language in the world). 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# (pronounced See Sharp), (the .NET version of JavaScript), 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.NOTE Microsoft includes an interesting tool named the IL Disassembler (ILDASM) with the .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).中文翻译 和 .NET Framework是微软.NET框架总体战略的一部分。
探究ASP.NET MVC 毕业论文 外文翻译中英文对照
![探究ASP.NET MVC 毕业论文 外文翻译中英文对照](https://img.taocdn.com/s3/m/fae894de0b4e767f5bcfce6b.png)
MVC In-Depth: The Life of an MVC RequestThe purpose of this blog entry is to describe, in painful detail, each step in the life of an MVC request from birth to death. I want to understand everything that happens when you type a URL in a browser and hit the enter key when requesting a page from an MVC website. Why do I care? There are two reasons. First, one of the promises of MVC is that it will be a very extensible framework. For example, you’ll be able to plug in different view engines to control how your website content is rendered. You also will be able to manipulate how controllers get generated and assigned to particular requests. I want to walk through the steps involved in an MVC page request because I want to discover any and all of these extensibility points. Second, I’m interested in Test-Driven Development. In order to write unit tests for controllers, I need to understand all of the controller dependencies. When writing my tests, I need to mockce rtain objects using a mocking framework such as Typemock Isolator or Rhino Mocks. If I don’t understand the page request lifecycle, I won’t be able to effectively mock it.Two WarningsBut first, two warnings.Here's the first warning: I’m writing this blo g entry a week after the MVC Preview 2 was publicly released. The MVC framework is still very much in Beta. Therefore, anything that I describe in this blog entry might be outdated and, therefore, wrong in a couple of months. So, if you are reading this blog entry after May 2008, don’t believe everything you read. Second, this blog entry is not meant as an overview of MVC. I describe the lifecycle of an MVC request in excruciating and difficult to read detail. Okay, you have been warned.Overview of the Lifecycle StepsThere are five main steps that happen when you make a request from an MVC website: 1. Step 1 – The RouteTable is CreatedThis first step happens only once when an application first starts. The RouteTable maps URLs to handlers.2. Step 2 – The UrlRoutingModule Intercepts the RequestThis second step happens whenever you make a request. The UrlRoutingModule intercepts every request and creates and executes the right handler.3. Step 3 – The MvcHandler ExecutesThe MvcHandler creates a controller, passes the controller a ControllerContext, and executes the controller.4. Step 4 – The Controller ExecutesThe controller determines which controller method to execute, builds a list of parameters, and executes the method.5. Step 5 – The RenderView Method is CalledTypically, a controller method calls RenderView() to render content back to the browser. The Controller.RenderView() method delegates its work to a particular ViewEngine.Let’s examine each of th ese steps in detail.Step 1 : The RouteTable is CreatedWhen you request a page from a normal application, there is a page on disk that corresponds to each page request. For example, if you request a page named SomePage.aspx thenthere better be a page named SomePage.aspx sitting on your web server. If not, you receive an error.Technically, an page represents a class. And, not just any class. An page is a handler. In other words, an page implements the IHttpHandler interface and has a ProcessRequest() method that gets called when you request the page. The ProcessRequest() method is responsible for generating the content that gets sent back to the browser.So, the way that a normal application works is simple and intuitive. You request a page, the page request corresponds to a page on disk, the page executes its ProcessRequest() method and content gets sent back to the browser.An MVC application does not work like this. When you request a page from an MVC application, there is no page on disk that corresponds to the request. Instead, the request is routed to a special class called a controller. The controller is responsible for generating the content that gets sent back to the browser.When you write a normal application, you build a bunch of pages. There is always a one-to-one mapping between URLs and pages. Corresponding to each page request, there better be a page.When you build an MVC application, in contrast, you build a bunch of controllers. The advantage of using controllers is that you can have a many-to-one mapping between URLs and pages. For example, all of the following URLs can be mapped to the same controller:The single controller mapped to these URLs can display product information for the right product by extracting the product Id from the URL. The controller approach is more flexible than the classic approach. The controller approach also results in more readable and intuitive URLs.So, how does a particular page request get routed to a particular controller? An MVC application has something called a Route Table. The Route Table maps particular URLs to particular controllers.An application has one and only one Route Table. This Route Table is setup in the Global.asax file. Listing 1 contains the default Global.asax file that you get when you create a new MVC Web Application project by using Visual Studio.An application’s Route Table is represented by the static RouteTable.Routes property. This property represents a collection of Route objects. In the Global.asax file in Listing 1, two Route objects are added to the Route Table when the application first starts (The Application_Start() method is called only once when the very first page is requested from a website).A Route object is responsible for mapping URLs to handlers. In Listing 1, two Route objects are created. Both Route objects map URLs to the MvcRouteHandler. The first Route maps any URL that follows the pattern {controller}/{action}/{id} to the MvcRouteHandler. The second Route maps the particular URL Default.aspx to the MvcRouteHandler.By the way, this new routing infrastructure can be used independently of an MVC application. The Global.asax file maps URLs to the MvcRouteHandler. However, you have the option of routing URLs to a different type of handler. The routing infrastructure described in this section is contained in a distinct assembly named System.Web.Routing.dll. You can use the routing without using the MVC.Step 2 : The UrlRoutingModule Intercepts the RequestWhenever you make a request against an MVC application, the request is interceptedby the UrlRoutingModule HTTP Module. An HTTP Module is a special type of class that participates in each and every page request. For example, classic includes a FormsAuthenticationModule HTTP Module that is used to implement page access security using Forms Authentication.When the UrlRoutingModule intercepts a request, the first thing the module does is to wrap up the current HttpContext in an HttpContextWrapper2 object. The HttpContextWrapper2 class, unlike the normal HttpContext class, derives from the HttpContextBase class. Creating a wrapper for HttpContext makes it easier to mock the class when you are using a Mock Object Framework such as Typemock Isolator or Rhino Mocks.Next, the module passes the wrapped HttpContext to the RouteTable that was setup in the previous step. The HttpContext includes the URL, form parameters, query string parameters, and cookies associated with the current request. If a match can be made between the current request and one of the Route objects in the Route Table, then a RouteData object is returned.If the UrlRoutingModule successfully retrieves a RouteData object then the module next creates a RouteContext object that represents the current HttpContext and RouteData. The module then instantiates a new HttpHandler based on the RouteTable and passes the RouteContext to the new handler’s constructor.In the case of an MVC application, the handler returned from the RouteTable will always be an MvcHandler (The MvcRouteHandler returns an MvcHandler). Whenever the UrlRoutingModule can match the current request against a Route in the Route Table, an MvcHandler is instantiated with the current RouteContext.The last step that the module performs is setting the MvcHandler as the current HTTP Handler.An application calls the ProcessRequest() method automatically on the current HTTP Handler which leads us to the next step.Step 3 : The MvcHandler ExecutesIn the previous step, an MvcHandler that represents a particular RouteContext was set as the current HTTP Handler. An application always fires off a certain series of events including Start, BeginRequest, PostResolveRequestCache, PostMapRequestHandler, PreRequestHandlerExecute, and EndRequest events (there are a lot of application events – for a complete list, lookup the HttpApplication class in the Microsoft Visual Studio 2008 Documentation).Everything described in the previous section happens during the PostResolveRequestCache and PostMapRequestHandler events. The ProcessRequest() method is called on the current HTTP Handler right after the PreRequestHandlerExecute event.When ProcessRequest() is called on the MvcHandler object created in the previous section, a new controller is created. The controller is created from a ControllerFactory. This is an extensibility point since you can create your own ControllerFactory. The default ControllerFactory is named, appropriately enough, DefaultControllerFactory.The RequestContext and the name of the controller are passed to theControllerFactory.CreateController() method to get a particular controller. Next, a ControllerContext object is constructed from the RequestContext and the controller. Finally, the Execute() method is called on the controller class. The ControllerContext is passed to the Execute() method when the Execute() method is called.Step 4 : The Controller ExecutesThe Execute() method starts by creating the TempData object (called the Flash object in the Ruby on Rails world). The TempData can be used to store temporary data that must be used with the very next request (TempData is like Session State with no long-term memory).Next, the Execute() method builds a list of parameters from the request. These parameters, extracted from the request parameters, will act as method parameters. The parameters will be passed to whatever controller method gets executed.The Execute() method finds a method of the controller to execute by using reflection on the controller class (.NET reflection and not navel gazing reflection). The controller class is something that you wrote. So the Execute() method finds one of the methods that you wrote for your controller class and executes it. The Execute() method will not execute any controller methods that are decorated with the NonAction attribute.At this point in the lifecycle, we’ve entered your application code.Step 5 : The RenderView Method is CalledNormally, your controller methods end with a call to either the RenderView() or RedirectToAction() method. The RenderView() method is responsible for rendering a view (a page) to the browser.When you call a controller’s RenderView() method, the call is delegated to the current ViewEngine’s RenderView() method. The ViewEngine is another extensibility point. The default ViewEngine is the WebFormViewEngine. However, you can use another ViewEngine such as the NHaml ViewEngine.The WebFormViewEngine.RenderView() method uses a class named the ViewLocator class to find the view. Next, it uses a BuildManager to create an instance of a ViewPage class from its path. Next, if the page has a master page, the location of the master page is set (again, using the ViewLocator class). If the page has ViewData, the ViewData is set. Finally, the RenderView() method is called on the ViewPage.The ViewPage class derives from the base System.Web.UI.Page class. This is the same class that is used for pages in classic . The final action that RenderView() method performs is to call ProcessRequest() on the page class. Calling ProcessRequest() generates content from the view in the same way that content is generated from a normal page.Extensibility PointsThe MVC lifecycle was designed to include a number of extensibility points. These are points where you can customize the behavior of the framework by plugging in a custom class or overriding an existing class. Here’s a summary of these extensibility points:1. Route objects – When you build the Route Table, you call the RouteCollection.Add() method to add new Route objects. The Add() method accepts a RouteBase object. You can implement your own Route objects that inherit from the base RouteBase class.2. MvcRouteHandler – When building an MVC application, you map URLs to MvcRouteHandler objects. However, you can map a URL to any class that implements the IRouteHandler interface. The constructor for the Route class accepts any object that implements the IRouteHandler interface.3. MvcRouteHandler.GetHttpHandler() – The GetHttpHandler() method of the MvcRouteHandler class is a virtual method. By default, an MvcRouteHandler returns an MvcHandler. If you prefer, you can return a different handler by overriding the GetHttpHandler() method.4. ControllerFactory – You can assign a custom class by calling theSystem.Web.MVC.ControllerBuilder.Current.SetControllerFactory() method to create a custom controller factory. The controller factory is responsible for returning controllers for a given controller name and RequestContext.5. Controller – You can implement a custom controller by implementing the IController interface. This interface has a single method: Execute(ControllerContext controllerContext).6. ViewEngine – You can assign a custom ViewEngine to a controller. You assign a ViewEngine to a controller by assigning a ViewEngine to the public Controller.ViewEngine property. A ViewEngine must implement the IViewEngine interface which has a single method: RenderView(ViewContext viewContext).7. ViewLocator – The ViewLocator maps view names to the actual view files. You can assign a custom ViewLocator to the default WebFormViewEngine.ViewLocator property.If you can think of any other extensibility points that I overlooked, please add a comment to this blog post and I will update this entry.SummaryThe goal of this blog entry was to describe the entire life of an MVC request from birth to death. I examined the five steps involved in processing an MVC request: Creating the RouteTable, Intercepting the request with the UrlRoutingModule, Generating a Controller, Executing an Action, and Rendering a View. Finally, I talked about the points at which the MVC Framework can be extended.探究 MVC: MVC请求的生命周期本书详细描述了 MVC请求从开始到结束的整个过程,当你在浏览器上输入URL地址并且在网站请求页面敲击回车时,这个过程就产生了。
Asp net技术 毕业论文外文翻译
![Asp net技术 毕业论文外文翻译](https://img.taocdn.com/s3/m/2ea86c53e45c3b3567ec8be4.png)
技术的前身ASP技术,是在IIS 2.0上首次推出(Windows NT 3.51),当时与 ADO 1.0 一起推出,在IIS 3.0 (Windows NT 4.0)发扬光大,成为服务器端应用程序的热门开发工具,微软还特别为它量身打造了Visual 标识InterDev开发工具,在1994年到2000年之间,ASP技术已经成为微软推展Windows NT 4.0平台的关键技术之一,数以万计的ASP网站也是这个时候开始如雨后春笋般的出现在网络上。
它的简单以及高度可定制化的能力,也是它能迅速崛起的原因之一。
不过ASP的缺点也逐渐的浮现出来:意大利面型的程序开发方法,让维护的难度提高很多,尤其是大型的ASP应用程序。
直译式的VBScript或JScript语言,让效能有些许的受限。
延展性因为其基础架构扩充性不足而受限,虽然有COM元件可用,但开发一些特殊功能(像文件上传)时,没有来自内置的支持,需要寻求第三方软件商开发的元件。
1997年时,微软开始针对ASP的缺点(尤其是意大利面型的程序开发方法)准备开始一个新项目来开发,当时的主要领导人Scott Guthrie刚从杜克大学毕业,他和IIS团队的Mark Anders经理一起合作两个月,开发出了下一代ASP 技术的原型,这个原型在1997年的圣诞节时被发展出来,并给予一个名称:XSP,这个原型产品使用的是Java语言。
不过它马上就被纳入当时还在开发中的CLR平台,Scott Guthrie事后也认为将这个技术移植到当时的CLR平台,确实有很大的风险(huge risk),但当时的XSP团队却是以CLR开发应用的第一个团队。
为了将XSP移植到CLR中,XSP团队将XSP的内核程序全部以C#语言重新撰写,并且改名为ASP+,作为ASP技术的后继者,并且也会提供一个简单的移转方法给ASP开发人员。
ASP+首次的Beta版本以及应用在PDC 2000中亮相,由Bill Gates 主讲Keynote(即关键技术的概览),由富士通公司展示使用COBOL语言撰写ASP+应用程序,并且宣布它可以使用Visual 、C#、Perl与Python语言(后两者由ActiveState公司开发的互通工具支持)来开发。
(最新版)_毕业设计外文翻译_27413
![(最新版)_毕业设计外文翻译_27413](https://img.taocdn.com/s3/m/7580da9c83d049649b6658af.png)
南京邮电大学毕业设计(论文)外文资料翻译学院专业学生姓名班级学号外文出处附件:1.外文资料翻译译文;2.外文原文指导教师评价:1.翻译内容与课题的结合度:□优□良□中□差2.翻译内容的准确、流畅:□优□良□中□差3.专业词汇翻译的准确性:□优□良□中□差4.翻译字符数是否符合规定要求:□符合□不符合指导教师签名:年月日附件1:外文资料翻译译文非常1.1Web 部署项目当ASP 第一次发布时,Web 编程还比较困难,因为需要 IIS 来处理 ASP 页。
后来, 2.0 和Visual Studio® 2005 通过引入网站开发模型使一切工作都变得容易了。
借助该网站模型,您不必在 Visual Studio 中创建新项目,而是可以指向一个目录并开始编写网页和代码。
此外,您还可以使用内置的 Development Server 快速测试站点, Development Server 将 寄宿在一个本地进程中,并消除了必须安装 IIS 才能进行开发这一先决条件。
该网站模型的魅力在于您在开发 Web 应用程序时无需考虑打包和部署。
需要其他类时怎么办?向 App_Code 目录添加一个 .cs 文件即可开始编写。
希望将可本地化的字符串存储在资源文件中时怎么办?向App_GlobalResources 目录添加一个 .resx 文件并键入字符串。
一切都顺顺当当;您根本就不必考虑编译和部署方面的事情。
在准备进行部署时,您有多种可选方案。
最简单的方案是将文件复制到主运行服务器并按要求编译每一个文件(和在测试环境中一样)。
第二种方案是使用aspnet_compiler.exe 实用工具将应用程序预编译为二进制版本,之后将只剩下要放到服务器上的一组程序集、静态内容和配置文件。
第三种方案也使用 aspnet_compiler.exe,但要创建一个可更新的二进制部署,其中 .as*x 文件保持不变(并且可修改),而所有代码文件都编译为二进制程序集。
ASP论文外文翻译---从底层了解ASPNET的结构
![ASP论文外文翻译---从底层了解ASPNET的结构](https://img.taocdn.com/s3/m/4fd850b165ce0508763213a2.png)
原文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中英文对照外文翻译文献
![网络应用程序ASP中英文对照外文翻译文献](https://img.taocdn.com/s3/m/44c79737af45b307e87197c3.png)
中英文资料外文翻译文献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到摘要是微软公司基于网络应用程序新开发出的产品,这个产品的普及在的创新当中具有重大意义,因此在方面的教育有了很大的需求。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
出自:Chris Hart,Jokn Kauffman,David Sussman.《Beginning 2.0 with C# 》[M].Wrox,2006:125-131.英文原文AuthenticationOne area not yet discussed is that of how the authentication works for this application, and what options are available in for authentication. The examples so far have relied on what’s known as Forms authentication. So, what is Forms authentication, and what are the other options available?❑Forms authentication: Login requests are made by filling in a form on a web page and submitting that form to the server. When the server receives the request, a cookie is written to the user’s local machine, and this cookie is passed back to the server by the browser along with each request that is sent so that the user remains authenticated for as long as is required.❑Windows authentication: Login pages pass user credentials to a web server (IIS only, not the web server built into VWD). The web server then handles the authentication using whichever method is configured on the virtual directory that the application is running within. IIS hooks in to the Windows operating system and Active Directory domain structures, which means that it can rely on user profiles that are stored externally, and use standard Windows credentials to login to the site. Depending on the configuration of your site, and depending on which user account you used to log in to your machine, you may not even have to log in to the site directly, because your current Windows credentials can be passed to the web server automatically for authentication. This is really handy when it comes to developing intranet applications.❑Passport authentication:Login credentials are passed to a Microsoft Passport server where user profiles are stored centrally. You may be familiar with this from logging in to a Hotmail account. And because you can configure Windows to log on to a Passport account on startup, you can access your Hotmail inbox without even having to type a password.Forms Authentication Model.This section looks at how Forms authentication works. Consider the following scenario: ❑The user—let’s call him Bob—wants to view Page A, which can’t be accessed by anonymous users, so when Bob tries to view Page A, the browser instead displays a loginpage, as shown in Figure 4-29.Figure 4-29❑Bob is now looking at a login page. Because Bob registered with this site previously, he logs into the site using his username and password combination. Figure 4-30 shows the interaction between Bob’s browse r and the server.Figure 4-30❑Bob can now view Page A and is a happy user. Next, Bob wants to view Page B by following a link from Page A. Along with the request for the page, Bob’s browser sends a copy of the cookie to the server to let the server know that it’s Bob who’s trying to view the page. The server knows who Bob is, and likes Bob, so it sends Bob Page B as requested.Figure 4-31❑If Bob now requests the site’s home page, the browser will tack on the cookie to the request, so even though the home page is not restricted content, the cookie is still sent to the server. Because the page isn’t restricted, the server doesn’t worry abou t the cookie, ignores it, and sends back the home page.❑Bob then heads back to Page A. Because the cookie is fresh on Bob’s machine, the cookie is sent to the server. The server is still happy with Bob, so it lets Bob view the page.❑Bob goes off and makes himself a coffee. He then makes some lunch. By the time he gets back to his computer, 25 minutes have elapsed. Bob now wants to view Page B again, but the cookie on his machine has expired. The server doesn’t receive a cookie along with the page request, so Bob has to log back in again.Cookies on a user’s machine are normally set to expire after a specific amount of time has elapsed. In this scenario, the server gives out cookies with a 20-minute expiry, which means that as long as the user keeps making requests within 20 minutes of each other, the cookie will remain active. However, more than 20 minutes away from the site and the user will have to log back in to the site to view restricted content.The login page built in the earlier examples included a box that offered you the “remember my details for next time” option. This writes a more permanent cookie to your browser’s cookie collection so that your account name is pre-populated when you revisit the site. Because you should never store password information in a cookie, you should always have to enter your password, but at least your username field is filled in for you on each visit.Other methods of authentication—Windows and Passport—provide the end user with a similar experience.For example, the Windows authentication model relies on the web server (which will likely be IIS)to control access to the site, but it can also incorporate the timeout mechanism to block users that have been idle for too long. To configure Windows authentication, you need to specify which users or roles from the corporate Active Directory (AD) domain can access a site. These users can then access the site whenever they are logged on using their login details to a PC on the corporate network.It’s also possible to view a Win dows authenticated site from outside of the corporate environment, though you are asked to enter your standard Windows logon credentials when you attempt to access a page protected by Windows authentication.Server accepts cookie and sends back Page B Browser requests Page B and passes a copy of the cookie Browser Server Membership and Identity Passport authentication isn’t as widely adopted as Microsoft perhaps would have liked, but some sites on the Internet do link to the Passport network to handle web site authentication (for example,).Passport authentication relies on the entire repository of user accounts being accessible from anywhere in the wired world, a bit like a central active directory for web accounts.This book uses Forms authentication to handle all authentication with the Wrox United application.Wrox United SecurityThe Wrox United site that you’ve been working on so far needs to have some security applied to it if you want to be able to include some personalization in the site. In the finished site (),you’ll see that there is shopping cart functionality built in to the site. Additionally, the finished site will also have an administration area, where you can edit fixtures, team members, and much more. This all means that you’re going to have to add some users and roles at some stage. Because you have gained plenty of experience of using the configuration tool, you can now perform the first stage in this process.The next Try It Out walks you through the user accounts and roles configuration for the Wrox United site. At this stage, you don’t have to worry about locking down parts of the site—that’s a task for later in the book.Try It Out Configuring Security in the Wrox United Site1. Open the final version of the Wrox United site in VWD. Then click the Website menu and select Configuration. This launches the configuration tool for the site. Figure 4-32 shows the configuration screen that is displayed for the finished version of the site.Figure 4-322. Click the Security link to go to the section where you can configure users and roles. As you did previously in this chapter, launch the security setup wizard. As you walk through the wizard, select the following:❑The application will be used over the Internet.❑Roles are enabled.❑Roles should be defined for Administrator, FanClubMember, Manager, Owner, and Reporter (see Figure 4-33).3. Look at the user accounts. The user accounts predefined with the Wrox United application are shown in Figure 4-34.4. Take a look at the configuration for the finished application. You’ll see that the preconfigured user accounts are each members of different roles, so while the ChrisH account is a member of the Reporter role, Jim is a member of the Owners role, and Lou is a member of the Fan Club.5. After you finish the wizard, look at a couple of subfolders within the WroxUnited directory that contain specific areas of the site—the Admin and the FanClub sections. These areas have some access restrictions on them.Figure 4-33Figure 4-346. Go to the section for managing Access Rules and you’ll see the following rules:❑For the main WroxUnited folder, anonymous access is allowed.❑For the FanClub folder, only members of the FanClub role can access the folder—all other users are denied access.❑For the Admin folder, access is denied to all users.With the Wrox United application, you have access to the configuration of a fully functional web application.Feel free to have a look through this configuration using both the Administration Tool and the Web.config file to see how the basic permissions are enabled. This example is only a taste of what will come later in the book, because Chapter 11 covers the details of role-based access to a site and shows you different techniques for enabling and disabling content by role.The code generated for filtering access to the FanClub folder has been added to the Web.config file that lives within the FanClub folder. This code is as follows: <?xml version=”1.0”encoding=”utf-8”?><configuration><system.web><authorization><allow roles=”FanClubMember”/><deny users=”*”/></authorization></system.web></configuration>Notice that the FanClubMember role has been defined as the only role that has permission to access the content in this folder.The directory-level permission created in this example has created a restricted zone in the site. Chapter 11 walks through some examples using the Administration section and the Fan Club sections, demonstrating different parts of 2.0 technology. These examples will rely on an understanding of the foundations built in this section.This chapter discussed the basics of security, the concept of identity, and the process involved in logging on to a site. These are familiar concepts to anyone who spends time on the Internet, surfing fan sites, community portals, or online shops. Because these concepts are so universal, you’ve seen how 2.0 is designed to make the process of creating sites that use this functionality.The core concepts to understand are as follows:❑Identity: The concept of an individual as described by a set of attributes that make that individual unique.❑Authentication: The concept of identifying a user to a server by passing a set of credentials to the server. If the server can identify the user attempting to connect, he or she will be authenticated.❑Authorization:The process of taking authenticated user credentials and comparing them against a set of access control list information, providing the answer to the question “can this user access the requested resource?”❑Personalization: The capability to provide information that is specific to the currently logged-in user.❑ Membership:The concept of belonging. This chapter considered the concept of users being members of specific roles. The next chapter expands on the concept of personalization and looks at how sites can be personalized.中文翻译身份验证一个尚未讨论的问题是应用程序的身份验证是如何实现的,以及为身份验证提供了哪些选择。