ASP.NET外文翻译
ASP NET 5外文文献和翻译
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年。
旅行社管理系统中英文对照外文翻译文献
中英文对照外文翻译(文档含英文原文和中文翻译) Overview is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of coding. is part of the .NET Framework, and when coding applications you have access to classes in the .NET Framework. You can code your applications in any language compatible with the common language runtime (CLR), including Microsoft Visual Basic, C#, JScript .NET, and J#. These languages enable you to develop applications that benefit from the common language runtime, type safety, inheritance, and so on. includes:• A page and controls 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 design your 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 pageto 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 been compiled, the common language runtime further compiles code to native code, providing improved performance. includes a compiler that will compile all your application components including pages and controls into an assembly that the hosting environment can then use to service user requests.In addition to the security features of .NET, provides an advanced security infrastructure for authenticating and authorizing user access as well as performing other security-related tasks. You can authenticate users using Windows authentication supplied by IIS, or you can manage authentication using your own user database using forms authentication and membership. Additionally, you can manage the authorization to the capabilities and information of your Web application using Windows groups or your own custom role database using roles. You can easily remove, add to, or replace these schemes depending upon the needs of your application. always runs with a particular Windows identity so you can secure your application using Windows capabilities such as NTFS Access Control Lists (ACLs), database permissions, and so on. For more information on the identity of , provides intrinsic state management functionality that enables you 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.NoteThe Visual C# documentation assumes that you have an understanding of basic programming concepts. If you are a complete beginner, you might want to explore Visual C# Express Edition, which is available on the Web. You can also take advantage of any of several excellent books and Web resources on C# to learnpractical programming skills.C# syntax is highly expressive, yet with less than 90 keywords, it is also simple and easy to learn. The curly-brace syntax of C# will be instantly recognizable to anyone familiar with C, C++ or Java. Developers who know any of these languages are typically able to begin working productively in C# within a very short time. C# syntax simplifies many of the complexities of C++ while providing powerful features such as nullable value types, enumerations, delegates, anonymous methods and direct memory access, which are not found in Java. C# also supports generic methods and types, which provide increased type safety and performance, and iterators, which enable implementers of collection classes to define custom iteration behaviors that are simple to use by client code.As an object-oriented language, C# supports the concepts of encapsulation, inheritance and polymorphism. All variables and methods, including the Main method, the application's entry point, are encapsulated within class definitions. A class may inherit directly from one parent class, but it may implement any number of interfaces. Methodsthat 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 astack-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." Interop enables C# programs to do just about anything that a native C++ application can do. C# even supports pointers and the concept of "unsafe" code for those cases in which direct memory access is absolutely critical.The C# build process is simple compared to C and C++ and more flexible than in Java. There are no separate header files, and no requirement that methods and types be declared in a particular order. A C# source file may define any number of classes, structs, interfaces, and events.C# programs run on 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 otherCTS-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. 概述 是一个统一的 Web 开发模型,它包括您使用尽可能少的代码生成企业级 Web 应用程序所必需的各种服务。
ASP NET 概述中英文对照外文翻译文献
中英文资料对照外文翻译 概述 是一个统一的 Web 开发模型,它包括您使用尽可能少的代码生成企业级 Web 应用程序所必需的各种服务。
作为 .NET Framework 的一部分提供。
当您编写 应用程序的代码时,可以访问 .NET Framework 中的类。
您可以使用与公共语言运行库 (CLR) 兼容的任何语言来编写应用程序的代码,这些语言包括 Microsoft Visual Basic、C#、JScript .NET 和 J#。
使用这些语言,可以开发利用公共语言运行库、类型安全、继承等方面的优点的 应用程序。
包括:∙页和控件框架∙ 编译器∙安全基础结构∙状态管理功能∙应用程序配置∙运行状况监视和性能功能∙调试支持∙XML Web services 框架∙可扩展的宿主环境和应用程序生命周期管理∙可扩展的设计器环境 页和控件框架是一种编程框架,它在 Web 服务器上运行,可以动态地生成和呈现 网页。
可以从任何浏览器或客户端设备请求 网页, 会向请求浏览器呈现标记(例如 HTML)。
通常,您可以对多个浏览器使用相同的页,因为 会为发出请求的浏览器呈现适当的标记。
但是,您可以针对诸如 Microsoft Internet Explorer 6 的特定浏览器设计 网页,并利用该浏览器的功能。
支持基于 Web 的设备(如移动电话、手持型计算机和个人数字助理 (PDA))的移动控件。
网页是完全面向对象的。
在 网页中,可以使用属性、方法和事件来处理 HTML 元素。
页框架为响应在服务器上运行的代码中的客户端事件提供统一的模型,从而使您不必考虑基于 Web 的应用程序中固有的客户端和服务器隔离的实现细节。
该框架还会在页处理生命周期中自动维护页及该页上控件的状态。
使用 页和控件框架还可以将常用的 UI 功能封装成易于使用且可重用的控件。
控件只需编写一次,即可用于许多页并集成到 网页中。
英文文献及中文翻译_ASP.NET概述ASP.NETOverview
英文文献及中文翻译 Overview is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of is part of the .NET Framework, and when coding applications you have access to classes in the .NET Framework.You can code your applications in any language compatible with the common language runtime (CLR), including Microsoft Visual Basic and C#. These languages enable you to develop applications that benefit from the common language runtime, type safety, inheritance, and so on.If you want to try , you can install Visual Web Developer Express using the Microsoft Web Platform Installer, which is a free tool that makes it simple to download, install, and service components of the Microsoft Web Platform.These components include Visual Web Developer Express, Internet Information Services (IIS), SQL Server Express, and the .NET Framework. All of these are tools that you use to create Web applications. You can also use the Microsoft Web Platform Installer to install open-source and PHP Web applications.Visual Web DeveloperVisual Web Developer is a full-featured development environment for creating Web applications. Visual Web Developer provides an ideal environment in which to build Web sites and then publish them to a hosting site. Using the development tools in Visual Web Developer, you can develop Web pages on your own computer. Visual Web Developer includes a local Web server that provides all the features you need to test and debug Web pages, without requiring Internet Information Services (IIS) to be installed.Visual Web Developer provides an ideal environment in which to build Web sitesand then publish them to a hosting site. Using the development tools in Visual Web Developer, you can develop Web pages on your own computer. Visual Web Developer includes a local Web server that provides all the features you need to test and debug Web pages, without requiring Internet Information Services (IIS) to be installed.When your site is ready, you can publish it to the host computer using the built-in Copy Web tool, which transfers your files when you are ready to share them with others. Alternatively, you can precompile and deploy a Web site by using the Build Web Site command. The Build Web Sitecommand runs the compiler over the entire Web site (not just the code files) and produces a Web site layout that you can deploy to a production server.Finally, you can take advantage of the built-in support for File Transfer Protocol (FTP).Using the FTP capabilities of Visual Web Developer, you can connect directly to the host computer and then create and edit files on the server. Web Sites and Web Application ProjectsUsing Visual Studio tools, you can create different types of projects, which includes Web sites, Web applications, Web services, and AJAX server controls.There is a difference between Web site projects and Web application projects. Some features work only with Web application projects, such as MVC and certain tools for automating Web deployment. Other features, such as Dynamic Data, work with both Web sites and Web application projects.Page and Controls FrameworkThe page and controls framework is a programming framework that runs on a Web server to dynamically produce and render Web pages. Web pages can be requested from any browser or client device, and renders markup (such as HTML) to the requesting browser. As a rule, you can use the samepage for multiple browsers, because renders the appropriate markup for the browser making the request. However, you can design your Web page to target a specific browser and take advantage of the features of that browser. Web pages are completely object-oriented. Within Web pages you can work with HTML elements using properties, methods, and events. The page framework removes the implementation details of the separation of client and server inherent in Web-based applications by presenting a unified model for responding to client events in code that runs at the server. The framework also automatically maintains the state of a page and the controls on that page during the page processing life cycle.The page and controls framework also enables you to encapsulate common UI functionality in easy-to-use, reusable controls. Controls are written once, can be used in many pages, and are integrated into the Web page that they are placed in during rendering.The page and controls framework also provides features to control the overall look and feel of your Web site via themes and skins. You can define themes and skins and then apply them at a page level or at a control level.In addition to themes, you can define master pages that you use to create a consistent layout for the pages in your application. A single master page defines the layout and standard behavior that you want for all the pages (or a group of pages) in your application. You can then create individual content pages that contain the page-specific content you want to display. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page. The page framework also enables you to define the pattern for URLs that will be used in your site. This helps with search engine optimization (SEO) and makes URLs more user-friendly.The page and control framework is designed to generate HTML thatconforms to accessibility guidelines. CompilerAll code is compiled, which enables strong typing, performance optimizations, and early binding, among other benefits. Once the code has been compiled, the common language runtime further compiles code to native code, providing improved performance. includes a compiler that will compile all your application components including pages and controls into an assembly that the hosting environment can then use to service user requests.Security InfrastructureIn addition to the security features of .NET, provides an advanced security infrastructure for authenticating and authorizing user access as well as performing other security-related tasks. You can authenticate users using Windows authentication supplied by IIS, or you can manage authentication using your own user database using forms authentication and membership. Additionally, you can manage the authorization to the capabilities and information of your Web application using Windows groups or your own custom role database using roles. You can easily remove, add to, or replace these schemes depending upon the needs of your application. always runs with a particular Windows identity so you can secure your application using Windows capabilities such as NTFS Access Control Lists (ACLs),database permissions, and so on.State-Management Facilities provides intrinsic state management functionality that enables you to store information between page requests, such as customer information or the contents of a shopping cart. You can save and manage application-specific, session-specific, page-specific, user-specific, and developer-defined information. This information can beindependent of any controls on the page. offers distributed state facilities, which enable you to manage state information across multiple instances of the same application on one computer or on several computers. 概述是一个统一的Web开发模型,它包括您使用尽可能少的代码生成企业级Web应用程序所必需的各种服务。
ASP NET 2.0网页和Web控件-外文翻译
外文翻译毕业设计题目:基于的物业管理系统开发原文1: 2.0 Web Pagesand Web Controls译文1: 2.0 网页和Web控件原文2:The Role of Global.asax File 译文2:Global.asax文件的作用原文1 2.0 Web Pages and Web Controls U ntil now, all of the example applications in this text have focused on console-based and Windows Forms front ends. In this chapter and the next, you’ll explore how the .NET platform facilitates the construction of browser-based presentation layers. To begin, you’ll quickly review a number of key web-centric concepts (HTTP, HTML, client-side, and server-side script) and the role of the web server (including the development server, WebDev.WebServer.exe).With this web primer out of the way, the remainder of this chapter concentrates on the composition of (including the enhanced code-behind model) and how to work with web controls. As you will see, 2.0 provides a number of new web controls, a new “master page”model, and various customization techniques.The Role of HTTPWeb applications are very different animals from traditional desktop applications (to say the least).The first obvious difference is that a production-level web application will always involve at least two networked machines (of course, during development it is entirely possible to have a single machine play the role of both client and server). Given this fact, the machines in question must agree upon a particular wire protocol to determine how to send and receive data. The wire protocol that connects the computers in question is the Hypertext Transfer Protocol (HTTP).When a client machine launches a web browser (such as Netscape Navigator, Mozilla Firefox,or Microsoft Internet Explorer), an HTTP request is made to access a particular resource (such as an *.aspx or *.htm file) on the remote server machine. HTTP is a text-based protocol that is built upon a standard request/response paradigm. For example, if you navigate to www. , the browser software leverages a web technology termed Domain Name Service (DNS) that converts the registered URL into a four-part, 32-bit numerical value (aka an IP address). At this point, the browser opens a socket connection (typically via port 80) and sends the HTTP request for the default page at the website.Once the hosting web server receives the incoming HTTP request, the specified resource may contain logic that scrapes out any client-supplied input values (such as values within a text box) in order to format a proper HTTP response. Web programmers may leverage any number of technologies (CGI, ASP, , Java servlets, etc.) to dynamically generate the content to be emitted into theHTTP response. At this point, the client-side browser renders the HTML emitted from the web server.Another aspect of web development that is markedly different from traditional desktop programming is the fact that HTTP is an essentially stateless wire protocol. As soon as the web server emits a response to the client, everything about the previous interaction is forgotten. Therefore, as a web developer, it is up to you take specific steps to “remember” information (such as items in a shopping cart) about the clients who are currently logged on to your site. As you will see in the next chapter, provides numerous ways to handle state, many of which are commonplace to any web platform (session variables, cookies, and application variables) as well as some new techniques (view state, control state, and the cache).Understanding Web Applications and Web ServersA web application can be understood as a collection of files (*.htm, *.asp, *.aspx, image files, etc.) and related components (such as a .NET code library) stored within a particular set of directories on a given web server. As shown in Chapter 24, web applications have a specific life cycle and provide numerous events (such as initial startup or final shutdown) that you can hook into.A web server is a software product in charge of hosting your web applications, and it typically provides a number of related services such as integrated security, File Transfer Protocol (FTP) support, mail exchange services, and so forth. Internet Information Server (IIS) is Microsoft’s enterprise-level web server product, and as you would guess, it has intrinsic support for classic ASP as well as web applications.When you build web applications, you will often need to interact with IIS. Be aware, however, that IIS is not automatically selected when you install the Windows Server 2003 or Windows XP Professional Edition (you can’t install IIS on the Home editions of Windows). Therefore, depend ing on the configuration of your development machine, you may be required to manually install IIS before proceeding through this chapter. To do so, simply access the Add/Remove Program applet from the Control Panel folder and select Add/Remove Windows Components.Working with IIS Virtual DirectoriesA single IIS installation is able to host numerous web applications, each of which resides in a virtual directory. Each virtual directory is mapped to a physical directory on the local hard drive. Therefore,if you create a new virtual directory named CarsRUs, the outside world can navigate to this site using a URL such as (assuming your site’s IP address has been registeredwith the world at large). Under the hood, the virtual directory maps to a physical root directory such as C:\inetpub\wwwroot\AspNetCarsSite, which contains the content of the web application.When you create web applications using Visual Studio 2005, you have the option of generating a new virtual directory for the current website. However, you are also able to manually create a virtual directory by hand. For the sake of illustration, assume you wish to create a simple web application named Cars. The first step is to create a new folder on your machine to hold the collection of files that constitute this new site (e.g., C:\CodeTests\CarsWebSite).Next, you need to create a new virtual directory to host the Cars site. Simply right-click the Default Web Site node of IIS and select New ➤Virtual Directory from the context menu. This menu selection launches an integrated wizard. Skip past the welcome screen and give your website a name (Cars). Next, you are asked to specify the physical folder on your hard drive that contains the various files and images that represent this site (in this case, C:\CodeTests\CarsWebSite).The final step of the wizard prompts you for some basic traits about your new virtual directory (such as read/write access to the files it contains, the ability to view these files from a web browser, the ability to launch executables [e.g., CGI applications], etc.). For this example, the default selections are just fine (be aware that you can always modify your selections after running this tool using variousright-click Property dialog boxes integrated within IIS).译文1作者:迪诺·弗雷国籍:美国出处: 2.0 and Data-Bound Controls 2.0网页和Web控件到现在为止,本书的示例应用程序主要集中在控制台和基于Windows窗体前端。
asp.net外文文献+翻译
技术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技术及数据库管理外文原文+中文翻译
服务器上运行。将程序在服务器端首次运行时进行编译,比 ASP 即时解释程序速 度上要快很多.而且是可以用任何与 . net 兼容的语言(包括 Visual Basic . net、 C# 和 JScript . net.)创作应用程序。另外,任何 ASP. net 应用程序都可以使用 整个 . net Framework。开发人员可以方便地获得这些技术的优点,其中包括托管 的 公 共 语 言 运 行 库 环 境 、 类 型 安 全 、 继 承 等 等 。 ASP. net 可 以 无 缝 地 与 WYSIWYG HTML 编辑器和其他编程工具(包括 Microsoft Visual Studio . net) 一起工作。这不仅使得 Web 开发更加方便,而且还能提供这些工具必须提供的 所有优点, 包括开发人员可以用来将服务器控件拖放到 Web 页的 GUI 和完全集 成的调试支持。 当创建 ASP. net 应用程序时,开发人员可以使用 Web 窗体或 XML Web services,或以他们认为合适的任何方式进行组合。每个功能都能得到 同一结构的支持,使您能够使用身份验证方案,缓存经常使用的数据,或者对应 用程序的配置进行自定义. 如果你从来没有开发过网站程序,那么这不适合你,你 应该至少掌握一些 HTML 语言和简单的 Web 开发术语(不过我相信如果有兴趣的 话是可以很快的掌握的)。你不需要先前的 ASP 开发经验(当然有经验更好) ,但 是你必须了解交互式 Web 程序开发的概念, 包含窗体, 脚本, 和数据接口的概念, 如果你具备了这些条件的话,那么你就可以在 的世界开始展翅高飞了。 不仅仅是 Active Server Page (ASP) 的下一个版本,而且是一种建立 在通用语言上的程序构架,能被用于一台 Web 服务器来建立强大的 Web 应用程 序。 提供许多比现在的 Web 开发模式强大的优势。 ASP. net 运行的架构分为几个阶段: 在 IIS 与 Web 服务器中的消息流动阶段。 在 ASP. net 网页中的消息分 派。 在 ASP. net 网页中的消息处理。 ASP. net 的原始设计构想,就是要让开发人员能够像 VB 开发工具那样,可 以使用事件驱动式程序开发模式 (Event-Driven Programming Model) 的方法来 开发网页与应用程序,若要以 ASP 技术来做到这件事的话,用必须要使用大量的 辅助信息,像是查询字符串或是窗体字段数据来识别与判断对象的来源、事件流 向以及调用的函数等等,需要撰写的代码量相当的多,但 ASP. net 很巧妙利用窗 体字段和 JavaScript 脚本把事件的传递模型隐藏起来了。 在 ASP. net 运行的时候, 经常会有网页的来回动作 (round-trip), 在 ASP. net 中称为 PostBack,在传统的 ASP 技术上,判断网页的来回是需要由开发人员自 行撰写,到了 ASP. net 时,开发人员可以用 Page.IsPostBack 机能来判断是否 为第一次运行 (当 发现 HTTP POST 要求的数据是空值时), 它可以保 证 ASP. net 的控件事件只会运行一次,但是它有个缺点(基于 HTTP POST 本 身的缺陷) ,就是若用户使用浏览器的刷新功能 (按 F5 或刷新的按钮) 刷新网页 时,最后一次运行的事件会再被运行一次,若要避免这个状况,必须要强迫浏览 器清空高速缓存才可以。
ASP.NET外文翻译
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 Y ou See Is What Y ou 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 being fit 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 foundyour 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 to improve 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 deplo ying , 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 Pages and the .NET Framework is part of Microsoft's overall .NET framework, which contains a vast set of programming classes designed to satisfy any conceivable programming need. In the following two sections, you learn how fits within the .NET framework, and you learn about the languages you can use in your pages.The .NET Framework Class LibraryImagine that you are Microsoft. Imagine that you have to support multiple programming languages—such as Visual Basic, JScript, and C++. A great deal of the functionality of these programming languages overlaps. For example, for each language, you would have to include methods for accessing the file system, working with databases, and manipulating strings.Furthermore, these languages contain similar programming constructs. Every language, for example, can represent loops and conditionals. Even though the syntax of a conditional written in Visual Basic differs from the syntax of a conditional written in C++, the programming function is the same.Finally, most programming languages have similar variable data types. In most languages, you have some means of representing strings and integers, for example. The maximum and minimum size of an integer might depend on the language, but the basic data type is the same.Maintaining all this functionality for multiple languages requires a lot of work. Why keep reinventing the wheel? Wouldn't it be easier to create all this functionality once and use it for every language?The .NET Framework Class Library does exactly that. It consists of a vast set of classes designed to satisfy any conceivable programming need. For example,the .NET framework contains classes for handling database access, working with the file system, manipulating text, and generating graphics. In addition, it contains more specialized classes for performing tasks such as working with regular expressions and handling network protocols.The .NET framework, furthermore, contains classes that represent all the basic variable data types such as strings, integers, bytes, characters, and arrays.Most importantly, for purposes of this book, the .NET Framework Class Library contains classes for building pages. You need to understand, however, that you can access any of the .NET framework classes when you are building your pages.Understanding NamespacesAs you might guess, the .NET framework is huge. It contains thousands of classes (over 3,400). Fortunately, the classes are not simply jumbled together. The classes of the .NET framework are organized into a hierarchy of namespaces.ASP Classic NoteIn previous versions of Active Server Pages, you had access to only five standard classes (the Response, Request, Session, Application, and Server objects). , in contrast, provides you with access to over 3,400 classes!A namespace is a logical grouping of classes. For example, all the classes that relate to working with the file system are gathered together into the System.IO namespace. The namespaces are organized into a hierarchy (a logical tree). At the root of the tree is the System namespace. This namespace contains all the classes for the base data types, such as strings and arrays. It also contains classes for working with random numbers and dates and times.You can uniquely identify any class in the .NET framework by using the full namespace of the class. For example, to uniquely refer to the class that represents a file system file (the File class), you would use the following:System.IO.FileSystem.IO refers to the namespace, and File refers to the particular class.NOTEYou can view all the namespaces of the standard classes in the .NET Framework Class Library by viewing the Reference Documentation for the .NET Framework. Standard NamespacesThe classes contained in a select number of namespaces are available in your pages by default. (You must explicitly import other namespaces.) These default namespaces contain classes that you use most often in your applications:System— Contains all the base data types and other useful classes such as those related to generating random numbers and working with dates and times.System.Collections— Contains classes for working with standard collection types such as hash tables, and array lists.System.Collections.Specialized— Contains classes that represent specializedcollections such as linked lists and string collections.System.Configuration— Contains classes for working with configuration files (Web.config files).System.Text— Contains classes for encoding, decoding, and manipulating the contents of strings.System.Text.RegularExpressions— Contains classes for performing regularexpression 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 yourserver-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 chapter to display errors, seeing an error message on the page might be difficult. For example, you might have to scroll down to the 48th form field to find the error message.Fortunately, Microsoft includes a ValidationSummary control with the Validation controls. You can use this control to summarize all the errors at the top of a page, or wherever else you want.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. 技术简介不仅仅是 Active Server Page (ASP) 的下一个版本,而且是一种建立在通用语言上的程序构架,能被用于一台Web服务器来建立强大的Web应用序。
软件 外文翻译 外文文献 英文文献 ASP NET 概述
英文原文 Overview is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of coding. is part of the .NET Framework, and when coding applications you have access to classes in the .NET Framework. You can code your applications in any language compatible with the common language runtime (CLR), including Microsoft Visual Basic, C#, JScript .NET, and J#. These languages enable you to develop applications that benefit from the common language runtime, type safety, inheritance, and so on. includes:A page and controls frameworkThe compilerSecurity infrastructureState-management facilitiesApplication configurationHealth monitoring and performance featuresDebugging supportAn XML Web services frameworkExtensible hosting environment and application life cycle managementAn extensible designer environmentThe page and controls framework is a programming framework that runs on a Web server to dynamically produce and render Web pages. Web pages can be requested from any browser or client device, and renders markup (such as HTML) to the requesting browser. Web pages are completely object-oriented. Within Web pages you can work with HTML elements using properties, methods, and events. The page framework removes the implementation details of the separation of client and server inherent in Web-based applications by presenting a unified model forresponding to client events in code that runs at the server. The framework also automatically maintains the state of a page and the controls on that page during the page processing life cycle.The page and controls framework also enables you to encapsulate common UI functionality in easy-to-use, reusable controls. Controls are written once, can be used in many pages, and are integrated into the Web page that they are placed in during rendering.The page and controls framework also provides features to control the overall look and feel of your Web site via themes and skins. You can define themes and skins and then apply them at a page level or at a control level.All code is compiled, which enables strong typing, performance optimizations, and early binding, among other benefits. Once the code has been compiled, the common language runtime further compiles code to native code, providing improved performance. includes a compiler that will compile all your application components including pages and controls into an assembly that the hosting environment can then use to service user requests.In addition to the security features of .NET, provides an advanced security infrastructure for authenticating and authorizing user access as well as performing other security-related tasks. You can authenticate users using Windows authentication supplied by IIS, or you can manage authentication using your own user database using forms authentication and membership. Additionally, you can manage the authorization to the capabilities and information of your Web application using Windows groups or your own custom role database using roles. You can easily remove, add to, or replace these schemes depending upon the needs of your application. always runs with a particular Windows identity so you can secure your application using Windows capabilities such as NTFS Access Control Lists (ACLs), database permissions, and so on. For more information on the identity of , provides intrinsic state management functionality that enables you tostore information between page requests, such as customer information or the contents of a shopping cart. You can save and manage application-specific, session-specific, page-specific, user-specific, and developer-defined information. This information can be independent of any controls on the page. offers distributed state facilities, which enable you to manage state information across multiple instances of the same application on one computer or on several computers. applications use a configuration system that enables you to define configuration settings for your Web server, for a Web site, or for individual applications. You can make configuration settings at the time your applications are deployed and can add or revise configuration settings at any time with minimal impact on operational Web applications and servers. configuration settings are stored in XML-based files. Because these XML files are ASCII text files, it is simple to make configuration changes to your Web applications. You can extend the configuration scheme to suit your requirements. includes features that enable you to monitor health and performance of your application. health monitoring enables reporting of key events that provide information about the health of an application and about error conditions. These events show a combination of diagnostics and monitoring characteristics and offer a high degree of flexibility in terms of what is logged and how it is logged. supports two groups of performance counters accessible to your applications:The system performance counter groupThe application performance counter group takes advantage of the run-time debugging infrastructure to provide cross-language and cross-computer debugging support. You can debug both managed and unmanaged objects, as well as all languages supported by the common language runtime and script languages.In addition, the page framework provides a trace mode that enablesyou to insert instrumentation messages into your Web pages. supports XML Web services. An XML Web service is a component containing business functionality that enables applications to exchange information across firewalls using standards like HTTP and XML messaging. XML Web services are not tied to a particular component technology or object-calling convention. As a result, programs written in any language, using any component model, and running on any operating system can access XML Web services. includes an extensible hosting environment that controls the life cycle of an application from when a user first accesses a resource (such as a page) in the application to the point at which the application is shut down. While relies on a Web server (IIS) as an application host, provides much of the hosting functionality itself. The architecture of enables you to respond to application events and create custom HTTP handlers and HTTP modules.Introduction to the C# Language and the .NET Framework C# is an elegant and type-safe object-oriented language that enables developers to build a wide range of secure and robust applications that run on the .NET Framework. You can use C# to create traditional Windows client applications, XML Web services, distributed components, client-server applications, database applications, and much, much more. Microsoft Visual C# 2005 provides an advanced code editor, convenient user interface designers, integrated debugger, and many other tools to facilitate rapid application development based on version 2.0 of the C# language and the .NET Framework.The Visual C# documentation assumes that you have an understanding of basic programming concepts. If you are a complete beginner, you might want to explore Visual C# Express Edition, which is available on the Web. You can also take advantage of any of several excellent books and Web resources on C# to learn practical programming skills.C# syntax is highly expressive, yet with less than 90 keywords, it is also simple and easy to learn. The curly-brace syntax of C# will be instantly recognizable to anyone familiar with C, C++ or Java. Developers who know any of these languages are typically able to begin working productively in C# within a very short time. C#syntax simplifies many of the complexities of C++ while providing powerful features such as nullable value types, enumerations, delegates, anonymous methods and direct memory access, which are not found in Java. C# also supports generic methods and types, which provide increased type safety and performance, and iterators, which enable implementers of collection classes to define custom iteration behaviors that are simple to use by client code.As an object-oriented language, C# supports the concepts of encapsulation, inheritance and polymorphism. All variables and methods, including the Main method, the application's entry point, are encapsulated within class definitions. A class may inherit directly from one parent class, but it may implement any number of interfaces. Methods that override virtual methods in a parent class require the override keyword as a way to avoid accidental redefinition. In C#, a struct is like a lightweight class; it is a stack-allocated type that can implement interfaces but does not support inheritance.In addition to these basic object-oriented principles, C# facilitates the development of software components through several innovative language constructs, including:C# programs run on the .NET Framework, an integral component of Windows that includes a virtual execution system called the common language runtime (CLR) and a unified set of class libraries. The CLR is Microsoft's commercial implementation of the common language infrastructure (CLI), an international standard that is the basis for creating execution and development environments in which languages and libraries work together seamlessly.Source code written in C# is compiled into an intermediate language (IL) that conforms to the CLI specification. The IL code, along with resources such as bitmaps and strings, is stored on disk in an executable file called an assembly, typically with an extension of .exe or .dll. An assembly contains a manifest that provides information on the assembly's types, version, culture, and security requirements.中文翻译 概述 是一个统一的Web 开发模型,它包括您使用尽可能少的代码生成企业级Web 应用程序所必需的各种服务。
外文翻译---ASPNET介绍以及内联代码和共享
附录 1 英文原文Introduction to Pages and Inline Code and Share[10] The Web Forms page framework is a scalable common language runtime programming model that can be used on the server to dynamically generate Web pages. Intended as a logical evolution of ASP ( provides syntax compatibility with existing pages), the page framework has been specifically designed to address a number of key deficiencies in the previous model. In particular, it provides the ability to create and use reusable UI controls that can encapsulate common functionality and thus reduce the amount of code that a page developer has to write, the ability for developers to cleanly structure their page logic in an orderly fashion (not "spaghetti code"), and the ability for development tools to provide strong WYSIWYG design support for pages (existing classic ASP code is opaque to tools). This section of the QuickStart provides a high-level code walkthrough of some basic page features. Subsequent sections of the QuickStart drill down into more specific details. pages are text files with an .htm file name extension. Pages consist of code and markup and are dynamically compiled and executed on the server to produce a rendering to the requesting client browser (or device). They can be deployed throughout an IIS virtual root directory tree. When a browser client requests .htm resources, the runtime parses and compiles the target file into a .NET Framework class. This class can then be used to dynamically process incoming requests. (Note that the .htm file is compiled only the first time it is accessed; the compiled type instance is then reused across multiple requests).An page can be created simply by taking an existing HTML file and changing its file name extension to .htm (no modification of code is required). For example, the following sample demonstrates a simple HTML page that collects a user's name and category preference and then performs a form postback to the originating page when a button is clicked:Important: Note that nothing happens yet when you click the Lookup button. Thisis because the .htm file contains only static HTML (no dynamic content). Thus, the same HTML is sent back to the client on each trip to the page, which results in a loss of the contents of the form fields (the text box and drop-down list) between requests. provides syntax compatibility with existing ASP pages. This includes support for <% %> code render blocks that can be intermixed with HTML content within an .htm file. These code blocks execute in a top-down manner at page render time.The below example demonstrates how <% %> render blocks can be used to loop over an HTML block (increasing the font size each time):Important: Unlike with ASP, the code used within the above <% %> blocks is actually compiled--not interpreted using a script engine. This results in improved runtime execution performance. page developers can utilize <% %> code blocks to dynamically modify HTML output much as they can today with ASP. For example, the following sample demonstrates how <% %> code blocks can be used to interpret results posted back from a client.Important: While <% %> code blocks provide a powerful way to custom manipulate the text output returned from an page, they do not provide a clean HTML programming model. As the sample above illustrates, developers using only <% %> code blocks must custom manage page state between round trips and custom interpret posted values.In addition to code and markup, pages can contain server controls, which are programmable server-side objects that typically represent a UI element in the page, such as a textbox or image. Server controls participate in the execution of the page and produce their own markup rendering to the client. The principle advantage of server controls is that they enable developers to get complex rendering and behaviors from simple building-block components, dramatically reducing the amount of code it takes to produce a dynamic Web page. Another advantage of server controls is that it is easy to customize theirrendering or behavior. Server controls expose properties that can be set either declaratively (on the tag) or programmatically (in code). Server controls (and the page itself) also expose events that developers can handle to perform specific actions during the page execution or in response to a client-side action that posts the page back to the server (a "postback"). Server controls also simplify the problem of retaining state across round-trips to the server, automatically retaining their values across successive postbacks.Server controls are declared within an .htm file using custom tags or intrinsic HTML tags that contain a runat="server" attribute value. Intrinsic HTML tags are handled by one of the controls in the System.Web.UI.HtmlControls namespace. Any tag that doesn't explicitly map to one of the controls is assigned the type of System.Web.UI.HtmlControls.HtmlGenericControl.Important: Note that these server controls automatically maintain anyclient-entered values between round trips to the server. This control state is not stored on the server (it is instead stored within an <input type="hidden"> form field that is round-tripped between requests). Note also that no client-side script is required.In addition to supporting standard HTML input controls, enables developers to utilize richer custom controls on their pages. For example, the following sample demonstrates how the <asp:adrotator> control can be used to dynamically display rotating ads on a page.Each server control is capable of exposing an object model containing properties, methods, and events. developers can use this object model to cleanly modify and interact with the page.Note, however, how much cleaner and easier the code is in this new server-control-based version. As we will see later in the tutorial, the page Framework also exposes a variety of page-level events that you can handle to write code to execute a specific time during the processing of the page. Examples of these events are Page_Load and Page_Render.The example below demonstrates a simple page with three servercontrols, a TextBox, Button, and a Label. Initially these controls just render their HTML form equivalents. However, when a value is typed in the TextBox and the Button is clicked on the client, the page posts back to the server and the page handles this click event in the code of the page, dynamically updating the Text property of the Label control. The page then re-renders to reflect the updated text. This simple example demonstrates the basic mechanics behind the server control model that has made one of the easiest Web programming models to learn and master.Note that in the preceding example the event handler for the Button was located between <script></script>tags in the same page containing the server controls. calls this type of page programming code-inline, and it is very useful when you want to maintain your code and presentation logic in a single file. However, also supports another way to factor your code and presentation content, called the code-behind model. When using code-behind, the code for handling events is located in a physically separate file from the page that contains server controls and markup. This clear delineation between code and content is useful when you need to maintain these separately, such as when more than one person is involved in creating the application. It is often common in group projects to have designers working on the UI portions of an application while developers work on the behavior or code. The code-behind model is well-suited to that environment. 2.0 introduces an improved runtime for code-behind pages that simplifies the connections between the page and code. In this new code-behind model, the page is declared as a partial class, which enables both the page and code files to be compiled into a single class at runtime. The page code refers to the code-behind file in the CodeFile attribute of the <%@ Page %>directive, specifying the class name in the Inherits attribute. Note that members of the code behind class must be either public or protected (they cannot be private).The advantage of the simplified code-behind model over previous versions is that you do not need to maintain separate declarations of server control variablesin the code-behind class. Using partial classes (new in 2.0) allows the server control IDs of the ASPX page to be accessed directly in the code-behind file. This greatly simplifies the maintenance of code-behind pages.Although you can place code inside each page within your site (using the inline or code-behind separation models described in the previous section), there are times when you will want to share code across several pages in your site. It would be inefficient and difficult to maintain this code by copying it to every page that needs it. Fortunately, provides several convenient ways to make code accessible to all pages in an application.Just as pages can be compiled dynamically at runtime, so can arbitrary code files (for example .cs or .vb files). 2.0 introduces the App_Code directory, which can contain standalone files that contain code to be shared across several pages in your application. Unlike 1.x, which required these files to be precompiled to the Bin directory, any code files in the App_Code directory will be dynamically compiled at runtime and made available to the application. It is possible to place files of more than one language under the App_Code directory, provided they are partitioned in subdirectories (registered with a particular language in Web.config). The example below demonstrates using the App_Code directory to contain a single class file called from the page.By default, the App_Code directory can only contain files of the same language. However, you may partition the App_Code directory into subdirectories (each containing files of the same language) in order to contain multiple languages under the App_Code directory. To do this, you need to register each subdirectory in the Web.config file for the application.<configuration><system.web><compilation><codeSubDirectories><add directoryName="Subdirectory"/></codeSubDirectories></compilation></system.web></configuration>Supported in version 1, the Bin directory is like the Code directory, except it can contain precompiled assemblies. This is useful when you need to use code that is possibly written by someone other than yourself, where you don't have access to the source code (VB or C# file) but you have a compiled DLL instead. Simply place the assembly in the Bin directory to make it available to your site. By default, all assemblies in the Bin directory are automatically loaded in the app and made accessibe to pages. You may need to Import specific namespaces from assemblies in the Bin directory using the @Import directive at the top of the page.The .NET Framework 2.0 includes a number of assemblies that represent the various parts of the Framework. These assemblies are stored in the global assembly cache, which is a versioned repository of assemblies made available to all applications on the machine (not just a specific application, as is the case with Bin and App_Code). Several assemblies in the Framework are automatically made available to applications. You can register additional assemblies by registration in a Web.config file in your application.<configuration><compilation><assemblies><add assembly="System.Data, Version=1.0.2411.0,Culture=neutral,PublicKeyToken=b77a5c561934e089"/></assemblies></compilation></configuration>附录 2 中文译文介绍以及内联代码和共享 Web 窗体页框架是一种可用于在服务器上动态生成网页的可伸缩公共语言运行库编程模型。
ASP外文翻译原文
毕业设计(论文)外文参考资料及译文译文题目:《技术》学生姓名:陈韡学号: 1205201005 专业:计算机科学与技术(专转本)所在学院:计算机工程学院指导教师:朱勇职称:教授2016年 3月 16日ASP. Net Technology——download from CSDN is a unified Web development model that includes the services necessary for you to build enterprise-class Web applications with a minimum of coding. is part of the .NET Framework, and when coding applications you have access to classes in the .NET Framework. You can code your applications in any language compatible with the common language runtime (CLR), including Microsoft Visual Basic, C#, JScript .NET, and J#. These languages enable you to develop applications that benefit from the common language runtime, type safety, inheritance, and so on. includes:∙ A page and controls framework∙The compiler∙Security infrastructure∙State-management facilities∙Application configuration∙Health monitoring and performance features∙Debugging support∙An XML Web services framework∙Extensible hosting environment and application life cycle management∙An extensible designer environmentThe page and controls framework is a programming framework that runs on a Web server to dynamically produce and render Web pages. Web pages can be requested from any browser or client device, and renders markup (such as HTML) to the requesting browser. As a rule, you can use the same page for multiple browsers, because renders the appropriate markup for the browser making the request. However, you can designyour Web page to target a specific browser, such as Microsoft Internet Explorer 6, and take advantage of the features of that browser. supports mobile controls for Web-enabled devices such as cellular phones, handheld computers, and personal digital assistants (PDAs). Web pages are completely object-oriented. Within Web pages you can work with HTML elements using properties, methods, and events. The page framework removes the implementation details of the separation of client and server inherent in Web-based applications by presenting a unified model for responding to client events in code that runs at the server. The framework also automatically maintains the state of a page and the controls on that page during the page processing life cycle.The page and controls framework also enables you to encapsulate common UI functionality in easy-to-use, reusable controls. Controls are written once, can be used in many pages, and are integrated into the Web page that they are placed in during rendering.The page and controls framework also provides features to control the overall look and feel of your Web site via themes and skins. You can define themes and skins and then apply them at a page level or at a control level.In addition to themes, you can define master pages that you use to create a consistent layout for the pages in your application. A single master page defines the layout and standard behavior that you want for all the pages (or a group of pages) in your application. You can then create individual content pages that contain the page-specific content you want to display. When users request the content pages, they merge with the master page to produce output that combines the layout of the master page with the content from the content page.All code is compiled, which enables strong typing, performance optimizations, and early binding, among other benefits. Once the code has beencompiled, the common language runtime further compiles code to native code, providing improved performance. includes a compiler that will compile all your application components including pages and controls into an assembly that the hosting environment can then use to service user requests.In addition to the security features of .NET, provides an advanced security infrastructure for authenticating and authorizing user access as well as performing other security-related tasks. You can authenticate users using Windows authentication supplied by IIS, or you can manage authentication using your own user database using forms authentication and membership. Additionally, you can manage the authorization to the capabilities and information of your Web application using Windows groups or your own custom role database using roles. You can easily remove, add to, or replace these schemes depending upon the needs of your application. always runs with a particular Windows identity so you can secure your application using Windows capabilities such as NTFS Access Control Lists (ACLs), database permissions, and so on. For more information on the identity of , provides intrinsic state management functionality that enables you to store information between page requests, such as customer information or the contents of a shopping cart. You can save and manage application-specific, session-specific, page-specific, user-specific, and developer-defined information. This information can be independent of any controls on the page. offers distributed state facilities, which enable you to manage state information across multiple instances of the same application on one computer or on several computers. applications use a configuration system that enables you to define configuration settings for your Web server, for a Web site, or for individual applications. You can make configuration settings at the time your applications are deployed and can add or revise configuration settings at any time with minimal impact on operational Web applications and servers. configuration settings are stored in XML-based files. Because these XML files are ASCII text files, it is simple to make configuration changes to your Web applications. You can extend the configuration scheme to suit your requirements. includes features that enable you to monitor health and performance of your application. health monitoring enables reporting of key events that provide information about the health of an application and about error conditions. These events show a combination of diagnostics and monitoring characteristics and offer a high degree of flexibility in terms of what is logged and how it is logged. supports two groups of performance counters accessible to your applications:∙The system performance counter group∙The application performance counter group takes advantage of the run-time debugging infrastructure to provide cross-language and cross-computer debugging support. You can debug both managed and unmanaged objects, as well as all languages supported by the common language runtime and script languages.In addition, the page framework provides a trace mode that enables you to insert instrumentation messages into your Web pages. supports XML Web services. An XML Web service is a component containing business functionality that enables applications to exchange information across firewalls using standards like HTTP and XML messaging. XML Web services are not tied to a particular component technology or object-calling convention. As a result, programs written in any language, using any component model, and running on any operating system can access XML Web services. includes an extensible hosting environment that controls the life cycle of an application from when a user first accesses a resource (such as a page) in the application to the point at which the application is shut down. While relies on a Web server (IIS) as an application host, provides much of the hosting functionality itself. The architecture of enables you to respond to application events and create custom HTTP handlers and HTTP modules. includes enhanced support for creating designers for Web server controls for use with a visual design tool such as Visual Studio. Designers enable you to build a design-time user interface for a control, so that developers can configure your control's properties and content in the visual design tool.Introduction to the C# Language and the .NET Framework C# is an elegant and type-safe object-oriented language that enables developers to build a wide range of secure and robust applications that run on the .NET Framework. You can use C# to create traditional Windows client applications, XML Web services, distributed components, client-server applications, database applications, and much, much more. Microsoft Visual C# 2005 provides an advanced code editor, convenient user interface designers, integrated debugger, and many other tools to facilitate rapid application development based on version 2.0 of the C# language and the .NET Framework.NoteC# syntax is highly expressive, yet with less than 90 keywords, it is also simple and easy to learn. The curly-brace syntax of C# will be instantly recognizable to anyone familiar with C, C++ or Java. Developers who know any of these languages are typically able to begin working productively in C# within a very short time. C# syntax simplifies many of the complexities of C++ while providing powerful features such as nullable value types, enumerations, delegates, anonymous methods and direct memory access, which are not found in Java. C# also supports generic methods and types, which provide increased type safety and performance, and iterators, which enable implementers of collection classes to define custom iteration behaviors that are simple to use by client code.As an object-oriented language, C# supports the concepts of encapsulation, inheritance and polymorphism. All variables and methods, including the Main method, the application's entry point, are encapsulated within class definitions. A class may inherit directly from one parent class, but it may implement any number of interfaces. Methods that override virtual methods in a parent class require the override keyword as a way to avoid accidental redefinition. In C#, a struct is like a lightweight class; it is a stack-allocated type that can implement interfaces but does not support inheritance.In addition to these basic object-oriented principles, C# facilitates the development of software components through several innovative language constructs, including:∙Encapsulated method signatures called delegates, which enable type-safe event notifications.∙Properties, which serve as accessors for private member variables.∙Attributes, which provide declarative metadata about types at run time.∙Inline XML documentation comments.If you need to interact with other Windows software such as COM objects or native Win32 DLLs, you can do this in C# through a process called "Interop." Interopenables C# programs to do just about anything that a native C++ application can do. C# even supports pointers and the concept of "unsafe" code for those cases in which direct memory access is absolutely critical.The C# build process is simple compared to C and C++ and more flexible than in Java. There are no separate header files, and no requirement that methods and types be declared in a particular order. A C# source file may define any number of classes, structs, interfaces, and events.C# programs run on the .NET Framework, an integral component of Windows that includes a virtual execution system called the common language runtime (CLR) and a unified set of class libraries. The CLR is Microsoft's commercial implementation of the common language infrastructure (CLI), an international standard that is the basis for creating execution and development environments in which languages and libraries work together seamlessly.Source code written in C# is compiled into an intermediate language (IL) that conforms to the CLI specification. The IL code, along with resources such as bitmaps and strings, is stored on disk in an executable file called an assembly, typically with an extension of .exe or .dll. An assembly contains a manifest that provides information on the assembly's types, version, culture, and security requirements.When the C# program is executed, the assembly is loaded into the CLR, which might take various actions based on the information in the manifest. Then, if the security requirements are met, the CLR performs just in time (JIT) compilation to convert the IL code into native machine instructions. The CLR also provides other services related to automatic garbage collection, exception handling, and resource management. Code that is executed by the CLR is sometimes referred to as "managed code," in contrast to "unmanaged code" which is compiled into native machine language that targets a specific system. The following diagram illustrates the compile-time and run time relationships of C# source code files, the base class libraries, assemblies, and the CLR.Language interoperability is a key feature of the .NET Framework. Because the IL code produced by the C# compiler conforms to the Common Type Specification (CTS), IL code generated from C# can interact with code that was generated from the .NET versions of Visual Basic, Visual C++, Visual J#, or any of more than 20 other CTS-compliant languages. A single assembly may contain multiple modules written in different .NET languages, and the types can reference each other just as if they were written in the same language.In addition to the run time services, the .NET Framework also includes an extensive library of over 4000 classes organized into namespaces that provide a wide variety of useful functionality for everything from file input and output to string manipulation to XML parsing, to Windows Forms controls. The typical C# application uses the .NET Framework class library extensively to handle common "plumbing" chores.中文一译文:技术——下载自CSDN网站 是一个统一的 Web 开发模型,它包括您使用尽可能少的代码生成企业级 Web 应用程序所必需的各种服务。
ASP.NET2.0数据库外文文献及翻译和参考文献-英语论文
2.0数据库外文文献及翻译和参考文献-英语论文 2.0数据库外文文献及翻译和参考文献参考文献[1] Matthew 高级程序设计[M].人民邮电出版社,2009.[2] 张领项目开发全程实录[M].清华大学出版社,2008.[3] 陈季实例指南与高级应用[M].中国铁道出版社,2008.[4] 郑霞2.0编程技术与实例[M].人民邮电出版社,2009.[5] 李俊民.精通SQL(结构化查询语言详解)[M].人民邮电出版社,2009.[6] 刘辉 .零基础学SQL Server 2005[M].机械工业出版社,2007.[7] 齐文海.ASP与SQL Server站点开发实用教程[M].机械工业出版社,2008.[8] 唐学忠.原文请找SQL Server 2000数据库教程[M]. 电子工业出版社,2005.[9] 王珊、萨师煊.数据库系统概论(第四版)[M].北京:高等教育出版社,2006.[10] Mani work Management Principles and Practive. Higher Education Press,2005,12VS2005中开发 2.0数据库程序一、简介在2005年11月7日,微软正式发行了.NET 2.0(包括 2.0),Visual Studio 2005和SQL Server 2005。
所有这些部件均被设计为可并肩独立工作。
也就是说,版本1.x和版本2.0可以安装在同一台机器上;你可以既有Visual 2002/2003和Visual Studio 2005,同时又有SQL Server 2000和SQL Server 2005。
而且,微软还在发行Visual Studio 2005和SQL Server 2005的一个 Express式的SKU。
注意,该Express版并不拥有专业版所有的特征。
2.0除了支持1.x风格的数据存取外,自身也包括一些新的数据源控件-它们使得访问和修改数据库数据极为轻松。
探究ASP.NET MVC 毕业论文 外文翻译中英文对照
MVC In-Depth: The Life of an MVC RequestThe purpose of this blog entry is to describe, in painful detail, each step in the life of an MVC request from birth to death. I want to understand everything that happens when you type a URL in a browser and hit the enter key when requesting a page from an MVC website. Why do I care? There are two reasons. First, one of the promises of MVC is that it will be a very extensible framework. For example, you’ll be able to plug in different view engines to control how your website content is rendered. You also will be able to manipulate how controllers get generated and assigned to particular requests. I want to walk through the steps involved in an MVC page request because I want to discover any and all of these extensibility points. Second, I’m interested in Test-Driven Development. In order to write unit tests for controllers, I need to understand all of the controller dependencies. When writing my tests, I need to mockce rtain objects using a mocking framework such as Typemock Isolator or Rhino Mocks. If I don’t understand the page request lifecycle, I won’t be able to effectively mock it.Two WarningsBut first, two warnings.Here's the first warning: I’m writing this blo g entry a week after the MVC Preview 2 was publicly released. The MVC framework is still very much in Beta. Therefore, anything that I describe in this blog entry might be outdated and, therefore, wrong in a couple of months. So, if you are reading this blog entry after May 2008, don’t believe everything you read. Second, this blog entry is not meant as an overview of MVC. I describe the lifecycle of an MVC request in excruciating and difficult to read detail. Okay, you have been warned.Overview of the Lifecycle StepsThere are five main steps that happen when you make a request from an MVC website: 1. Step 1 – The RouteTable is CreatedThis first step happens only once when an application first starts. The RouteTable maps URLs to handlers.2. Step 2 – The UrlRoutingModule Intercepts the RequestThis second step happens whenever you make a request. The UrlRoutingModule intercepts every request and creates and executes the right handler.3. Step 3 – The MvcHandler ExecutesThe MvcHandler creates a controller, passes the controller a ControllerContext, and executes the controller.4. Step 4 – The Controller ExecutesThe controller determines which controller method to execute, builds a list of parameters, and executes the method.5. Step 5 – The RenderView Method is CalledTypically, a controller method calls RenderView() to render content back to the browser. The Controller.RenderView() method delegates its work to a particular ViewEngine.Let’s examine each of th ese steps in detail.Step 1 : The RouteTable is CreatedWhen you request a page from a normal application, there is a page on disk that corresponds to each page request. For example, if you request a page named SomePage.aspx thenthere better be a page named SomePage.aspx sitting on your web server. If not, you receive an error.Technically, an page represents a class. And, not just any class. An page is a handler. In other words, an page implements the IHttpHandler interface and has a ProcessRequest() method that gets called when you request the page. The ProcessRequest() method is responsible for generating the content that gets sent back to the browser.So, the way that a normal application works is simple and intuitive. You request a page, the page request corresponds to a page on disk, the page executes its ProcessRequest() method and content gets sent back to the browser.An MVC application does not work like this. When you request a page from an MVC application, there is no page on disk that corresponds to the request. Instead, the request is routed to a special class called a controller. The controller is responsible for generating the content that gets sent back to the browser.When you write a normal application, you build a bunch of pages. There is always a one-to-one mapping between URLs and pages. Corresponding to each page request, there better be a page.When you build an MVC application, in contrast, you build a bunch of controllers. The advantage of using controllers is that you can have a many-to-one mapping between URLs and pages. For example, all of the following URLs can be mapped to the same controller:The single controller mapped to these URLs can display product information for the right product by extracting the product Id from the URL. The controller approach is more flexible than the classic approach. The controller approach also results in more readable and intuitive URLs.So, how does a particular page request get routed to a particular controller? An MVC application has something called a Route Table. The Route Table maps particular URLs to particular controllers.An application has one and only one Route Table. This Route Table is setup in the Global.asax file. Listing 1 contains the default Global.asax file that you get when you create a new MVC Web Application project by using Visual Studio.An application’s Route Table is represented by the static RouteTable.Routes property. This property represents a collection of Route objects. In the Global.asax file in Listing 1, two Route objects are added to the Route Table when the application first starts (The Application_Start() method is called only once when the very first page is requested from a website).A Route object is responsible for mapping URLs to handlers. In Listing 1, two Route objects are created. Both Route objects map URLs to the MvcRouteHandler. The first Route maps any URL that follows the pattern {controller}/{action}/{id} to the MvcRouteHandler. The second Route maps the particular URL Default.aspx to the MvcRouteHandler.By the way, this new routing infrastructure can be used independently of an MVC application. The Global.asax file maps URLs to the MvcRouteHandler. However, you have the option of routing URLs to a different type of handler. The routing infrastructure described in this section is contained in a distinct assembly named System.Web.Routing.dll. You can use the routing without using the MVC.Step 2 : The UrlRoutingModule Intercepts the RequestWhenever you make a request against an MVC application, the request is interceptedby the UrlRoutingModule HTTP Module. An HTTP Module is a special type of class that participates in each and every page request. For example, classic includes a FormsAuthenticationModule HTTP Module that is used to implement page access security using Forms Authentication.When the UrlRoutingModule intercepts a request, the first thing the module does is to wrap up the current HttpContext in an HttpContextWrapper2 object. The HttpContextWrapper2 class, unlike the normal HttpContext class, derives from the HttpContextBase class. Creating a wrapper for HttpContext makes it easier to mock the class when you are using a Mock Object Framework such as Typemock Isolator or Rhino Mocks.Next, the module passes the wrapped HttpContext to the RouteTable that was setup in the previous step. The HttpContext includes the URL, form parameters, query string parameters, and cookies associated with the current request. If a match can be made between the current request and one of the Route objects in the Route Table, then a RouteData object is returned.If the UrlRoutingModule successfully retrieves a RouteData object then the module next creates a RouteContext object that represents the current HttpContext and RouteData. The module then instantiates a new HttpHandler based on the RouteTable and passes the RouteContext to the new handler’s constructor.In the case of an MVC application, the handler returned from the RouteTable will always be an MvcHandler (The MvcRouteHandler returns an MvcHandler). Whenever the UrlRoutingModule can match the current request against a Route in the Route Table, an MvcHandler is instantiated with the current RouteContext.The last step that the module performs is setting the MvcHandler as the current HTTP Handler.An application calls the ProcessRequest() method automatically on the current HTTP Handler which leads us to the next step.Step 3 : The MvcHandler ExecutesIn the previous step, an MvcHandler that represents a particular RouteContext was set as the current HTTP Handler. An application always fires off a certain series of events including Start, BeginRequest, PostResolveRequestCache, PostMapRequestHandler, PreRequestHandlerExecute, and EndRequest events (there are a lot of application events – for a complete list, lookup the HttpApplication class in the Microsoft Visual Studio 2008 Documentation).Everything described in the previous section happens during the PostResolveRequestCache and PostMapRequestHandler events. The ProcessRequest() method is called on the current HTTP Handler right after the PreRequestHandlerExecute event.When ProcessRequest() is called on the MvcHandler object created in the previous section, a new controller is created. The controller is created from a ControllerFactory. This is an extensibility point since you can create your own ControllerFactory. The default ControllerFactory is named, appropriately enough, DefaultControllerFactory.The RequestContext and the name of the controller are passed to theControllerFactory.CreateController() method to get a particular controller. Next, a ControllerContext object is constructed from the RequestContext and the controller. Finally, the Execute() method is called on the controller class. The ControllerContext is passed to the Execute() method when the Execute() method is called.Step 4 : The Controller ExecutesThe Execute() method starts by creating the TempData object (called the Flash object in the Ruby on Rails world). The TempData can be used to store temporary data that must be used with the very next request (TempData is like Session State with no long-term memory).Next, the Execute() method builds a list of parameters from the request. These parameters, extracted from the request parameters, will act as method parameters. The parameters will be passed to whatever controller method gets executed.The Execute() method finds a method of the controller to execute by using reflection on the controller class (.NET reflection and not navel gazing reflection). The controller class is something that you wrote. So the Execute() method finds one of the methods that you wrote for your controller class and executes it. The Execute() method will not execute any controller methods that are decorated with the NonAction attribute.At this point in the lifecycle, we’ve entered your application code.Step 5 : The RenderView Method is CalledNormally, your controller methods end with a call to either the RenderView() or RedirectToAction() method. The RenderView() method is responsible for rendering a view (a page) to the browser.When you call a controller’s RenderView() method, the call is delegated to the current ViewEngine’s RenderView() method. The ViewEngine is another extensibility point. The default ViewEngine is the WebFormViewEngine. However, you can use another ViewEngine such as the NHaml ViewEngine.The WebFormViewEngine.RenderView() method uses a class named the ViewLocator class to find the view. Next, it uses a BuildManager to create an instance of a ViewPage class from its path. Next, if the page has a master page, the location of the master page is set (again, using the ViewLocator class). If the page has ViewData, the ViewData is set. Finally, the RenderView() method is called on the ViewPage.The ViewPage class derives from the base System.Web.UI.Page class. This is the same class that is used for pages in classic . The final action that RenderView() method performs is to call ProcessRequest() on the page class. Calling ProcessRequest() generates content from the view in the same way that content is generated from a normal page.Extensibility PointsThe MVC lifecycle was designed to include a number of extensibility points. These are points where you can customize the behavior of the framework by plugging in a custom class or overriding an existing class. Here’s a summary of these extensibility points:1. Route objects – When you build the Route Table, you call the RouteCollection.Add() method to add new Route objects. The Add() method accepts a RouteBase object. You can implement your own Route objects that inherit from the base RouteBase class.2. MvcRouteHandler – When building an MVC application, you map URLs to MvcRouteHandler objects. However, you can map a URL to any class that implements the IRouteHandler interface. The constructor for the Route class accepts any object that implements the IRouteHandler interface.3. MvcRouteHandler.GetHttpHandler() – The GetHttpHandler() method of the MvcRouteHandler class is a virtual method. By default, an MvcRouteHandler returns an MvcHandler. If you prefer, you can return a different handler by overriding the GetHttpHandler() method.4. ControllerFactory – You can assign a custom class by calling theSystem.Web.MVC.ControllerBuilder.Current.SetControllerFactory() method to create a custom controller factory. The controller factory is responsible for returning controllers for a given controller name and RequestContext.5. Controller – You can implement a custom controller by implementing the IController interface. This interface has a single method: Execute(ControllerContext controllerContext).6. ViewEngine – You can assign a custom ViewEngine to a controller. You assign a ViewEngine to a controller by assigning a ViewEngine to the public Controller.ViewEngine property. A ViewEngine must implement the IViewEngine interface which has a single method: RenderView(ViewContext viewContext).7. ViewLocator – The ViewLocator maps view names to the actual view files. You can assign a custom ViewLocator to the default WebFormViewEngine.ViewLocator property.If you can think of any other extensibility points that I overlooked, please add a comment to this blog post and I will update this entry.SummaryThe goal of this blog entry was to describe the entire life of an MVC request from birth to death. I examined the five steps involved in processing an MVC request: Creating the RouteTable, Intercepting the request with the UrlRoutingModule, Generating a Controller, Executing an Action, and Rendering a View. Finally, I talked about the points at which the MVC Framework can be extended.探究 MVC: MVC请求的生命周期本书详细描述了 MVC请求从开始到结束的整个过程,当你在浏览器上输入URL地址并且在网站请求页面敲击回车时,这个过程就产生了。
ASPNET是什么(计算机专业外文翻译)
外文文献原文What is ? is a programming framework built on the common language runtime that can be used on a server to build powerful Web applications. offers several important advantages over previous Web development models: Enhanced Performance. is compiled common language runtime code running on the server. Unlike its interpreted predecessors, can take advantage of early binding, just-in-time compilation, native optimization, and caching services right out of the box. This amounts to dramatically better performance before you ever write a line of code.World-Class Tool Support. The framework is complemented by a rich toolbox and designer in the Visual Studio integrated development environment. WYSIWYG editing, drag-and-drop server controls, and automatic deployment are just a few of the features this powerful tool provides.Power and Flexibility. Because is based on the common language runtime, the power and flexibility of that entire platform is available to Web application developers. The .NET Framework class library, Messaging, and Data Access solutions are all seamlessly accessible from the Web. is also language-independent, so you can choose the language that best applies to your application or partition your application across many languages. Further, common language runtime interoperability guarantees that your existing investment in COM-based development is preserved when migrating to .Simplicity. makes it easy to perform common tasks, from simple form submission and client authentication to deployment and site configuration. For example, the page framework allows you to build user interfaces that cleanly separate application logic from presentation code and to handle events in a simple, Visual Basic - like forms processing model. Additionally, the common language runtime simplifies development, with managed code services such as automatic reference counting and garbage collection.Manageability. employs a text-based, hierarchical configuration system, which simplifies applying settings to your server environment and Web applications. Because configuration information is stored as plain text, new settings may be applied without the aid of local administration tools. This "zero local administration" philosophy extends to deploying Framework applications as well. An Framework application is deployed to a server simply by copying the necessary files to the server. No server restart is required, even to deploy or replace running compiled code.Scalability and Availability. has been designed with scalability in mind, with features specifically tailored to improve performance in clustered and multiprocessor environments. Further, processes are closely monitored and managed by the runtime, so that if one misbehaves (leaks, deadlocks), a new process can be created in its place, which helps keep your application constantly available tohandle requests.Customizability and Extensibility. delivers a well-factored architecture that allows developers to "plug-in" their code at the appropriate level. In fact, it is possible to extend or replace any subcomponent of the runtime with your own custom-written component. Implementing custom authentication or state services has never been easier.Security. With built in Windows authentication and per-application configuration, you can be assured that your applications are secure.Data Binding Overview and Syntax introduces a new declarative data binding syntax. This extremely flexible syntax permits the developer to bind not only to data sources, but also to simple properties, collections, expressions, and even results returned from method calls. The following table shows some examples of the new syntax.Although this syntax looks similar to the ASP shortcut for Response.Write -- <%= %> -- its behavior is quite different. Whereas the ASP Response.Write shortcut syntax was evaluated when the page was processed, the data binding syntax is evaluated only when the DataBind method is invoked.DataBind is a method of the Page and all server controls. When you call DataBind on a parent control, it cascades to all of the children of the control. So, for example, DataList1.DataBind() invokes the DataBind method on each of the controls in the DataList templates. Calling DataBind on the Page -- Page.DataBind() or simply DataBind() -- causes all data binding expressions on the page to be evaluated. DataBind is commonly called from the Page_Load event, as shown in the following example.You can use a binding expression almost anywhere in the declarative section of an .aspx page, provided it evaluates to the expected data type at run time. The simple property, expression, and method examples above display text to the user when evaluated. In these cases, the data binding expression must evaluate to a value of type String. In the collection example, the data binding expression evaluates to a value of valid type for the DataSource property of ListBox. You might find it necessary to coerce the type of value in your binding expression to produce the desired result. For example, if count is an integer:Number of Records: <%# count.ToString() %>Binding to Simple PropertiesThe data binding syntax supports binding to public variables, properties of the Page, and properties of other controls on the page.The following example illustrates binding to a public variable and simple property on the page. Note that these values are initialized before DataBind() is called.The following example illustrates binding to a property of another control. Binding to Collections and ListsList server controls like DataGrid, ListBox and HTMLSelect use a collection as a data source. The following examples illustrate binding to usual common language runtime collection types. These controls can bind only to collections that support theIEnumerable, ICollection, or IListSource interface. Most commonly, you'll bind to ArrayList, Hashtable, DataView and DataReader.The following example illustrates binding to an ArrayList.The following example illustrates binding to a DataView. Note that the DataView class is defined in the System.Data namespace.The following example illustrates binding to a Hashtable.Binding Expressions or MethodsOften, you'll want to manipulate data before binding to your page or a control. The following example illustrates binding to an expression and the return value of a method.DataBinder.EvalThe framework supplies a static method that evaluates late-bound data binding expressions and optionally formats the result as a string. DataBinder.Eval is convenient in that it eliminates much of the explicit casting the developer must do to coerce values to the desired data type. It is particularly useful when data binding controls within a templated list, because often both the data row and the data field must be cast.Consider the following example, where an integer will be displayed as a currency string. With the standard data binding syntax, you must first cast the type of the data row in order to retrieve the data field, IntegerValue. Next, this is passed as an argument to the String.Format method.This syntax can be complex and difficult to remember. In contrast, DataBinder.Eval is simply a method with three arguments: the naming container for the data item, the data field name, and a format string. In a templated list like DataList, DataGrid, or Repeater, the naming container is always Container.DataItem. Page is another naming container that can be used with DataBinder.Eval.The format string argument is optional. If it is omitted, DataBinder.Eval returns a value of type object, as shown in the following example.It is important to note that DataBinder.Eval can carry a noticeable performance penalty over the standard data binding syntax because it uses late-bound reflection. Use DataBinder.Eval judiciously, especially when string formatting is not required.Section SummaryThe declarative data binding syntax uses the <%# %> notation.You can bind to data sources, properties of the page or another control, collections, expressions, and results returned from method calls.List controls can bind to collections that support the ICollection, IEnumerable, or IListSource interface, such as ArrayList, Hashtable, DataView, and DataReader.DataBinder.Eval is a static method for late binding. Its syntax can be simpler than the standard data binding syntax, but performance is slower.Section SummaryThe DataList and Repeater controls provide developers fine-tuned control over the rendering of data-bound lists.Rendering of bound data is controlled using a template, such as the HeaderTemplate, FooterTemplate, or ItemTemplate.The Repeater control is a general-purpose iterator, and does not insert anything in its rendering that is not contained in a template.The DataList control offers more control over the layout and style of items, and outputs its own rendering code for formatting.The DataList supports the Select, Edit/Update/Cancel, and Item Command events, which can be handled at the page level by wiring event handlers to the DataList's Command events.DataList supports a SelectedItemTemplate and EditItemTemplate for control over the rendering of a selected or editable item.Controls can be programmatically retrieved from a template using the Control.FindControl method. This should be called on a DataListItem retrieved from the DataList's Items collection.外文文献译文是什么?是一个能在规划好框架的服务器上建造强大的网络应用。
个性化定制ASP NET Whidbey中英文对照外文翻译文献
中英文资料对照外文翻译原文:Get Personal with WhidbeyConfigure the ProviderWith both personalization and membership, the first step is configuring the provider that you will use to store the personalization or membership data. Though you can create the Microsoft Access or Microsoft SQL Server™ database and add the necessary configuration elements manually, the easier way is to use the Web Site Administration tool, Note that to configure an application successfully, you must be logged in using an account with administrator rights (you also can launch Microsoft Visual Studio® .NET with an administrator-level account using Run As... and launch the Web Site Administration tool from the button in Solution Explorer).The Web Site Administration tool provides the means to configure personalization and membership features (the Membership data store is configured using the Security tab), as well as reports and data-access features.To create an Access .mdb file for storing personalization data, you need to open the Web Site Administration tool; the file, named AspNetDB.mdb, will be created automatically in a folder namedDA TA. Although not enabled in the build of Visual Studio against which this article was written, the Web Site Administration tool contains an entire section devoted to configuring personalization settings. In a later section, I'll walk you through adding the necessary configuration sections by hand.You configure the provider to use for membership services using the Security tab of the Web Site Administration tool. The easiest way to configure the membership provider is to select the Security Setup Wizard. I'll walk you through this process momentarily.At this point, the membership database will be created, and the necessary configuration elements will be added to the web.config file. All you need to do from here is add users to the database (which you can do using the Web Site Administration tool, or the membership APIs), set authorization restrictions on pages as desired, and create a login page.It is important to note that the database structure that is created for both personalization and membership is the same, so you can (and for efficiency's sake, should) use the same provider for both personalization and membership. That said, it is possible to use a different provider for personalization than for membership, and vice-versa, if you prefer.In addition to the built-in Access and SQL Server providers, you can create your own custom providers and configure your applications to use these providers. So, if you already have a user-credential database that you're not willing to part with, allows you to use that and still get the benefits that membership services provide. Note that at the time of this writing, the actual means for creating custom providers could undergo some changes still, so I'll save a demonstration of creating custom providers for a future article.How's the Data Stored?Use Server Explorer to see how data is stored in AspNetDB.mdb. Just create a database connection to AspNetDB.mdb and drag tables from the connection to a page in your site. Visual Studio will create a GridView control and bind it to an AccessDataSource control (note that the worker process must have read-write permissions on the folder containing the database for this to work). If you have difficulty browsing pages in the application, close the connection in Server Explorer before browsing the pages.Personalization and Membership: What do they mean?Personalization and membership enable you to control access to your application, as well as to store and retrieve information about users of your application, including anonymous users. You can customize the appearance and behavior of your application based on this information, and you even can allow users to store profile information, such as a shopping cart, while browsing anonymously, and later easily migrate that information to their personal profiles when they log in.Personalization allows you to store profile information about users of your application in a persistent data store. Personalization supports a pluggable data-provider layer and a set of APIs for storing and retrieving profile information in a strongly typed fashion. Personalization allows you to specify one or more arbitrary properties to be stored in a user's profile. You can specify the type of each property (which can be a system type or a user-defined type or custom class), as well as whether the property is tracked for anonymous users, whether the property is read-only or read-write, and more.Personalization also can be integrated with membership services to provide a unified solution for user management, login, and profile-information storage. By default, the personalization system associates profile information with the identity with which the user authenticates, accessible through . If you are using membership services foruser-credential management, then any time a user logs into your application, his or her membership identity automatically will be stored in , and all profile information associated with that identity will be available to the application. Support for storing profile information for anonymous users is not enabled by default and requires adding an element to the Web.config file for the application, as well as specifically making each desired property available for anonymous users.Membership describes the set of technologies, including (as with personalization) a back-end provider for storing data; a set of APIs for managing users and logins, and so on; and controls that allow you to add user-credential storage and related functionality to your application with no lines of code.User credentials are stored in a back-end membership database specified by the data provider you configure in Web.config. Whidbey ships with Access, and SQL Server providers are available out of the box. Once membership is configured, and users are added to the membership data store, adding login functionality to the application can be as simple as dragging a single control to a page in the application. The login controls (Login, LoginView, LoginStatus, LoginName, and PasswordRecovery) contain all of the logic necessary to validate credentials and perform any necessary redirection, and so on, and are designed to integrate with membership.Add Personalization PropertiesTo demonstrate personalization, next I'll show you how to add some property definitions and store and retrieve them from a page. One of the properties will allow the user to choose a page theme that will be used whenever the user visits. Themes are a new feature of Whidbey that allow you to modify the look and feel of an entire site with a simple configuration setting or a few lines of code.Open Web.config and add the following, directly after the <system.web> element:<anonymousIdentification enabled="true"/><personalization><profile><property name="Theme" allowAnonymous="true" /><property name="FavoriteColors"type="System.Collections.Specialized.StringCollection"allowAnonymous="true"serializeAs="Xml" /></profile></personalization>The <anonymousIdentification> element is required in order to allow anonymous access to any personalization properties. The personalization section contains two properties, both of which use the allowAnonymous attribute to enable the properties to be tracked for users who are not logged in. The first property, Theme, does not specify a type, so it will be treated as a string. The second property, FavoriteColors, specifies the StringCollection class as its type. Any attempt to store data that is not compatible with the StringCollection class in this property will result in an exception being thrown. The serializeAs attribute allows the StringCollection to be stored in the database as an XML string.Create a new Web Form in the project called Default.aspx. Then, switch to Design view and add the controls, with their properties set as specified.Table 1. Properties to be assigned to the controls added in the preceding example stepControl PropertiesDropDownList ID = ThemesButton ID = SetThemeText = Set ThemeTextBox ID = textFavColorButton ID = AddColorText = Add ColorListBox ID = listFavColorsSelect the DropDownList control and in the Properties window, scroll down to and select the Items property. Click the ellipsis button to open the Collection Editor. Add two items, one with the text and value set to BasicBlue and one set to SmokeAndGlass, and then click OK. Double-click the Set Theme button and add the following code to the event handler:Profile.Theme = Themes.SelectedValueAdd the following event handler to the Server Code window:Sub Page_PreInit(ByVal sender As Object, _ByVal e As System.EventArgs)If Profile.Theme = "" ThenIf Request.Form("Themes") <> "" ThenPage.Theme = Request.Form("Themes")End IfElsePage.Theme = Profile.ThemeEnd IfEnd SubThis code is required to set the page's theme, which must be set in the Page_PreInit event or earlier. The code checks to see whether a theme is already set for the user's personalization profile and uses that theme. If no theme exists, the code checks to see if the user has submitted the page with a new theme choice and, if so, uses the new theme. Otherwise, no theme will be applied.Switch back to Design view and double-click the Add Color button. Add the following code to the event handler:Dim FaveColor As String = _Server.HtmlEncode(textFavColor.Text)Dim FaveColors As New _System.Collections.Specialized.StringCollectionProfile.FavoriteColors.Add(FaveColor)DisplayFavoriteColors()Add the following subroutine just below the AddColor_Click handler:Sub DisplayFavoriteColors()listFavColors.DataSource = Profile.FavoriteColorslistFavColors.DataBind()End SubAdd the following line to the Page_Load event handler (if necessary, switch to Design view and double-click an empty area of the page to add the Page_Load handler):DisplayFavoriteColors()Now, save the page.Test the Personalization SettingsBrowse the page, select a theme from the DropDownList control and click Set Theme. You should see the theme applied to the controls. Next, type the name of a color in the text box and click Add Color. The color will be added to the list box, which is populated from the profile. After applying a theme and adding a couple of colors.Up to this point, the personalization information is being stored exclusively for anonymous users. But what if you want to take the information that's already been saved for an anonymous user and migrate it to a specific profile for a user when he or she logs in? Here's how: Add a Global.asax file to the Web site by right-clicking the site in Solution Explorer, selecting Add New Item, and choosing the Global Application Class template. Then, add the following code to Global.asax:Sub Personalization_MigrateAnonymous (sender As Object, _e As PersonalizationMigrateEventArgs)Profile.Theme = _Profile.GetProfile(e.AnonymousId).ThemeProfile.FavoriteColors = _Profile.GetProfile(e.AnonymousId).FavoriteColorsEnd SubIn Design view, add a Login control and a LoginName control (found on the Security tab of the toolbox) to Default.aspx, below the other controls, then save and browse the page. When the page is first displayed, no user name will be displayed by the LoginName control, and the page will display any properties you previously had set while browsing anonymously. Log in using the account credentials you added when configuring the membership database. The LoginName control will display your user ID now, and the Theme and FavoriteColors properties have been migrated to the profile for your logged-in account. Note that if you log in and then log out again, a new anonymous identity is created, and any personalization for the previous anonymous identity is no longer displayed.SummaryIn this article, I've demonstrated how the new personalization and membership features of Whidbey provide powerful functionality to your Web applications while requiring very little effort (and even less code!) to configure and use. In addition to the scenarios demonstrated in this article, personalization services can be used in conjunction with the new Web-parts feature of Whidbey to create powerful and easily customizable portals. Using personalization and membership, it is now possible to create rich, customized Web applications with robust security while writing little or no plumbing code, leaving you more time to focus on the business logic that enables the features your users actually care about.中文:个性化定制 Whidbey配置提供程序要使用个性化定制和成员身份,第一步是配置将用于存储个性化定制或成员身份数据的提供程序。
ASP NET 技术中英文对照外文翻译文献
中英文对照外文翻译文献(文档含英文原文和中文翻译)中英文资料对照外文翻译 Technique1. Building Pages and the .NET Framework is part of Microsoft's overall .NET framework, which contains a vast set of programming classes designed to satisfy any conceivable programming need. In the following two sections, you learn how fits within the .NET framework, and you learn about the languages you can use in your pages.The .NET Framework Class LibraryImagine that you are Microsoft. Imagine that you have to support multiple programming languages—such as Visual Basic, JScript, and C++. A great deal of the functionality of these programming languages overlaps. For example, for each language, you would have to include methods for accessing the file system, working with databases, and manipulating strings.Furthermore, these languages contain similar programming constructs. Every language, for example, can represent loops and conditionals. Even though the syntax of a conditional written in Visual Basic differs from the syntax of a conditional written in C++, the programming function is the same.Finally, most programming languages have similar variable data types. In most languages, you have some means of representing strings and integers, for example. The maximum and minimum size of an integer might depend on the language, but the basic data type is the same.Maintaining all this functionality for multiple languages requires a lot of work. Why keep reinventing the wheel? Wouldn't it be easier to create all this functionality once and use it for every language?The .NET Framework Class Library does exactly that. It consists of a vast set of classes designed to satisfy any conceivable programming need. For example, the .NET framework contains classes for handling database access, working with the file system, manipulating text, and generating graphics. In addition, it contains more specialized classes for performing tasks such as working with regular expressions and handling network protocols.The .NET framework, furthermore, contains classes that represent all the basic variable data types such as strings, integers, bytes, characters, and arrays.Most importantly, for purposes of this book, the .NET Framework Class Library contains classes for building pages. You need to understand, however, that you can access any of the .NET framework classes when you are building your pages.Understanding NamespacesAs you might guess, the .NET framework is huge. It contains thousands of classes (over 3,400). Fortunately, the classes are not simply jumbled together. The classes of the .NET framework are organized into a hierarchy of namespaces.ASP Classic NoteIn previous versions of Active Server Pages, you had access to only five standard classes (the Response, Request, Session, Application, and Server objects). , in contrast, provides you with access to over 3,400 classes!A namespace is a logical grouping of classes. For example, all the classes that relate to working with the file system are gathered together into the System.IO namespace.The namespaces are organized into a hierarchy (a logical tree). At the root of the tree is the System namespace. This namespace contains all the classes for the base data types, such as strings and arrays. It also contains classes for working with random numbers and dates and times.You can uniquely identify any class in the .NET framework by using the full namespace of the class. For example, to uniquely refer to the class that represents a file system file (the File class), you would use the following:System.IO.FileSystem.IO refers to the namespace, and File refers to the particular class.NOTEYou can view all the namespaces of the standard classes in the .NET Framework Class Library by viewing the Reference Documentation for the .NET Framework.Standard NamespacesThe classes contained in a select number of namespaces are available in your pages by default. (You must explicitly import other namespaces.) These default namespaces contain classes that you use most often in your applications:System— Contains all the base data types and other useful classes such as those related to generating random numbers and working with dates and times.System.Collections— Contains classes for working with standard collection types such as hash tables, and array lists.System.Collections.Specialized— Contains classes that represent specializedcollections such as linked lists and string collections.System.Configuration— Contains classes for working with configuration files(Web.config files).System.Text— Contains classes for encoding, decoding, and manipulating the contents of strings.System.Text.RegularExpressions— Contains classes for performing regular expression match and replace operations.System.Web— Contains the basic classes for working with the World Wide Web, including classes for representing browser requests and server responses.System.Web.Caching— Contains classes used for caching the content of pages and classes for performing custom caching operations.System.Web.Security— Contains classes for implementing authentication andauthorization such as Forms and Passport authentication.System.Web.SessionState— Contains classes for implementing session state.System.Web.UI— Contains the basic classes used in building the user interface of pages.System.Web.UI.HTMLControls— Contains the classes for the HTML controls.System.Web.UI.WebControls— Contains the classes for the Web controls..NET Framework-Compatible LanguagesFor purposes of this book, you will write the application logic for your pages using Visual Basic as your programming language. It is the default language for pages. Although you stick to Visual Basic in this book, you also need to understand that you can create pages by using any language that supports the .NET Common Language Runtime. Out of the box, this includes C#, , and the Managed Extensions to C++.NOTEThe CD included with this book contains C# versions of all the code samples.Dozens of other languages created by companies other than Microsoft have been developed to work with the .NET framework. Some examples of these other languages include Python, SmallTalk, Eiffel, and COBOL. This means that you could, if you really wanted to, write pages using COBOL.Regardless of the language that you use to develop your pages, you need to understand that pages are compiled before they are executed. This means that pages can execute very quickly.The first time you request an page, the page is compiled into a .NET class, and the resulting class file is saved beneath a special directory on your server named Temporary Files. For each and every page, a corresponding class file appears in the Temporary Files directory. Whenever you request the same page in the future, the corresponding class file is executed.When an page is compiled, it is not compiled directly into machine code. Instead, it is compiled into an intermediate-level language called Microsoft Intermediate Language (MSIL). All .NET-compatible languages are compiled into this intermediate language.An page isn't compiled into native machine code until it is actually requested by a browser. At that point, the class file contained in the Temporary Files directory is compiled with the .NET framework Just in Time (JIT) compiler and executed.The magical aspect of this whole process is that it happens automatically in the background. All you have to do is create a text file with the source code for your page, and the .NET framework handles all the hard work of converting it into compiled code for you.ASP CLASSIC NOTEWhat about VBScript? Before , VBScript was the most popular language for developing Active Server Pages. does not support VBScript, and this is good news. Visual Basic is a superset of VBScript, which means that Visual Basic has all the functionality of VBScript and more. So, you have a richer set of functions and statements with Visual Basic.Furthermore, unlike VBScript, Visual Basic is a compiled language. This means that if you use Visual Basic to rewrite the same code that you wrote with VBScript, you can get better performance.If you have worked only with VBScript and not Visual Basic in the past, don't worry. Since VBScript is so closely related to Visual Basic, you'll find it easy to make the transition between the two languages.NOTEMicrosoft includes an interesting tool named the IL Disassembler (ILDASM) withthe .NET framework. You can use this tool to view the disassembled code for any of the classes in the Temporary Files directory. It lists all the methods and properties of the class and enables you to view the intermediate-level code.This tool also works with all the controls discussed in this chapter. For example, you can use the IL Disassembler to view the intermediate-level code for the TextBox control (located in a file named System.Web.dll).Introducing Controls controls provide the dynamic and interactive portions of the user interface for your Web application. The controls render the content that the users of your Web site actually see and interact with. For example, you can use controls to create HTML form elements, interactive calendars, and rotating banner advertisements. controls coexist peacefully with HTML content. Typically, you create the static areas of your Web pages with normal HTML content and create the dynamic or interactive portions with controls.The best way to understand how controls work in an HTML page is to look at a simple Web Forms Page.Adding Application Logic to an PageThe second building block of an page is the application logic, which is the actual programming code in the page. You add application logic to a page to handle both control and page events.If a user clicks a Button control within an HTML form, for example, the Button control raises an event (the Click event). Typically, you want to add code to the page that does something in response to this event. For example, when someone clicks the Button control, you might want to save the form data to a file or database.Controls are not the only things that can raise events. An page itself raises several events every time it is requested. For example, whenever you request a page, the page's Load event is triggered. You can add application logic to the page that executes whenever the Load event occurs.2. Building Forms with Web Server ControlsBuilding Smart FormsYou use several of the basic Web controls to represent standard HTML form elements such as radio buttons, text boxes, and list boxes. You can use these controls in your pages to create the user interface for your Web application. The following sections provide detailed overviews and programming samples for each of these Web controls.Controlling Page NavigationIn the following sections, you learn how to control how a user moves from one page to another. First, you learn how to submit an HTML form to another page and retrieve form information. Next, you learn how to use the Redirect() method to automatically transfer a user to a new page. Finally, you learn how to link pages together with the HyperLink control.Applying Formatting to ControlsIn the following sections, you learn how to make more attractive Web forms. First, you look at an overview of the formatting properties common to all Web controls; they are the formatting properties of the base control class. Next, you learn how to apply Cascading Style Sheet styles and classes to Web controls.3. Performing Form Validation with Validation ControlsUsing Client-side ValidationTraditionally, Web developers have faced a tough choice when adding form validation logic to their pages. You can add form validation routines to your server-side code, or you can add the validation routines to your client-side code.The advantage of writing validation logic in client-side code is that you can provide instant feedback to your users. For example, if a user neglects to enter a value in a required formfield, you can instantly display an error message without requiring a roundtrip back to the server.People really like client-side validation. It looks great and creates a better overall user experience. The problem, however, is that it does not work with all browsers. Not all browsers support JavaScript, and different versions of browsers support different versions of JavaScript, so client-side validation is never guaranteed to work.For this reason, in the past, many developers decided to add all their form validation logic exclusively to server-side code. Because server-side code functions correctly with any browser, this course of action was safer.Fortunately, the Validation controls discussed in this chapter do not force you to make this difficult choice. The Validation controls automatically generate both client-side and server-side code. If a browser is capable of supporting JavaScript, client-side validation scripts are automatically sent to the browser. If a browser is incapable of supporting JavaScript, the validation routines are automatically implemented in server-side code.You should be warned, however, that client-side validation works only with Microsoft Internet Explorer version 4.0 and higher. In particular, the client-side scripts discussed in this chapter do not work with any version of Netscape Navigator.Requiring Fields: The RequiredFieldValidator ControlYou use RequiredFieldValidator in a Web form to check whether a control has a value. Typically, you use this control with a TextBox control. However, nothing is wrong with using RequiredFieldValidator with other input controls such as RadioButtonList. Validating Expressions: The RegularExpressionValidator ControlYou can use RegularExpressionValidator to match the value entered into a form field to a regular expression. You can use this control to check whether a user has entered, for example, a valid e-mail address, telephone number, or username or password. Samples of how to use a regular expression to perform all these validation tasks are provided in the following sections.Comparing Values: The CompareValidator ControlThe CompareValidator control performs comparisons between the data entered into a form field and another value. The other value can be a fixed value, such as a particular number, or a value entered into another control.Summarizing Errors: The ValidationSummary ControlImagine that you have a form with 50 form fields. If you use only the Validation controls discussed in the previous sections of this chapter to display errors, seeing an error message on the page might be difficult. For example, you might have to scroll down to the 48th form field to find the error message.Fortunately, Microsoft includes a ValidationSummary control with the Validation controls. You can use this control to summarize all the errors at the top of a page, or wherever else you want.4. Advanced Control ProgrammingWorking with View StateBy default, almost all controls retain the values of their properties between form posts. For example, if you assign text to a Label control and submit the form, when the page is rendered again, the contents of the Label control are preserved.The magic of view state is that it does not depend on any special server or browser properties. In particular, it does not depend on cookies, session variables, or application variables. View state is implemented with a hidden form field called VIEWSTATE that is automatically created in every Web Forms Page.When used wisely, view state can have a dramatic and positive effect on the performance of your Web site. For example, if you display database data in a control that has view state enabled, you do not have to return to the database each time the page is posted back to the server. You can automatically preserve the data within the page's view state between form posts.Displaying and Hiding ContentImagine that you are creating a form with an optional section. For example, imagine that you are creating an online tax form, and you want to display or hide a section that contains questions that apply only to married tax filers.Or, imagine that you want to add an additional help button to the tax form. You might want to hide or display detailed instructions for completing form questions depending on a user's preferences.Finally, imagine that you want to break the tax form into multiple pages so that a person views only one part of the tax form at a time.In the following sections, you learn about the properties that you can use to hide and display controls in a form. You learn how to use the Visible and Enabled properties with individual controls and groups of controls to hide and display page content.Using the Visible and Enabled PropertiesEvery control, including both HTML and Web controls, has a Visible property that determines whether the control is rendered. When a control's Visible property has the value False, the control is not displayed on the page; the control is not processed for eitherpre-rendering or rendering.Web controls (but not every HTML control) have an additional property named Enabled. When Enabled has the value False and you are using Internet Explorer version 4.0 or higher, the control appears ghosted and no longer functions. When used with other browsers, such as Netscape Navigator, the control might not appear ghosted, but it does not function.Disabling View StateIn certain circumstances, you might want to disable view state for an individual control or for an page as a whole. For example, you might have a control that contains a lot of data (imagine a RadioButtonList control with 1,000 options). You might not want to load the data into the hidden __VIEWSTATE form field if you are worried that the form data would significantly slow down the rendering of the page.Using Rich ControlsIn the following sections, you learn how to use three of the more feature-rich controls in the framework. You learn how to use the Calendar control to display interactive calendars, the AdRotator control to display rotating banner advertisements, and the HTMLInputFile control to accept file uploads.5 ConclusionThe advantages of using Struts to realize the website construction: It adopts JSPmarked mechanism to get the reusing codes and abstract codes. This method contributed to improve the reusability and flexibility of codes. When the technology space or the problem space varied, users have much more chances to reuse codes. Using open source, everybody in the user’s ro om could check up codes. Struts make the designers and developers pay their attention to their own favorite aspects. Adopting separately control ideology to manage the problem space. The websites based on this pattern had perfectly robustness. The layer structures were clear. As to huge scale of system, Struts conducted to manage complicated system. The disadvantages of using Struts to realize the website construction: The applicable scope of Struts is limited. Struts are MVC solution based on web. So it must be achieved by HTML, JSP document and Servlet and use J2EE application program to support Struts. Struts need to support JSP1.1 and Servlet 2.2 standard Servlet container. Of course, isolating the problem scope, but strengthening the complicacy, so one must accept some training before they adopt Struts development.References1. Selfa, D.M., Carrillo, M., Del Rocío Boone, M.: A database and web application based onMVC architecture. In: International Conference on Electronics, Communications and Computers, pp. 48–49 (2006)2. Lin, Y.-L., Hu, J.-P.: Design and implementation of the internet service platform for rural house building technique criteria and management based on .NET MVC. Applied Mechanics and Materials, 1727–1731 (2011)3. Wang, L.-H., Xi, M., Li, D.-X.: A network-friendly architecture for Multi-view VideoCoding (MVC). Advanced Materials Research, 678–681 (2010)4. Li, J.-M., Ma, G.-S., Feng, G., Ma, Y.-Q.: Research on Web Application of Struts Framework Based on MVC Pattern. In: Shen, H.T., Li, J., Li, M., Ni, J., Wang, W. (eds.) APWeb Workshops 2006. LNCS, vol. 3842, pp. 1029–1032. Springer, Heidelberg (2006) 技术摘要:页面的构建,验证以及编程。
aspnet外文翻译--常见的ASPNET代码技术
外文翻译译文:常见的代码技术:技巧,教程,代码——Scott Mitchell利用集合大多数现代编程语言提供支持某种类型的对象,可以容纳一个可变数目的元素。
这些对象被称为集合,他们可以轻易地添加和删除元素,而不必担心适当的内存分配。
如果你使用经典ASP编程之前,你就可能已经熟悉了脚本,字典对象,采集对象的每个元素包含一个参考文本的关键。
这种方式存储对象的集合被称为一个哈希表。
有许多类型的集合,除了哈希表。
每一种类型的集合是相似的目的:它作为一种手段来存储不同数量的元素,提供一种简单的方法,在最小程度上添加和删除元素。
每一个不同类型的集合是唯一的方法储存、检索并借鉴它的各种因素,而.NET框架提供了很多的集合类型为开发人员使用。
事实上,整个的命名空间系统集合是专门从事集合类型和辅助课程。
这些类型的集合都可以存储对象类型的元素。
因为在.NET中所有的原始数据类型的字符串,整数,日期/时间,阵列,都是从目标类派生的,这些集合可以从字面上存储任何东西。
例如,你可以使用一个单一的收集,存储一个整数,一个典型的COM组件,字符串,日期/时间,和自定义编写的.NET组件的两个实例,一个实例的组合。
大多数的例子在本节中使用集合来容纳原始数据类型(字符串,整数,双打)。
然而,集合表明集合类型存储为它的每个元素的整个集合。
在本节中,我们将研究5个集合的.NET框架为开发人员提供数组列表,哈希表,可排序列表,队列,堆栈。
当你学习这些集合时,就会意识到他们有许多相似之处。
例如,每一个类型的集合可以通过元素与元素的迭代使用每个在VB中的下一个循环(或在C#中的每一个循环)。
每个集合类型都有一定数量的同样的函数名执行同样的任务。
例如,每个集合类型都有一个明确的方法,从集合中移除所有元素集和属性来返回集合中的元素的数量。
事实上,过去的”相似性的集合类型”的共同特点就是来考察所发现的集合类型。
使用数组列表第一种收集我们要看的是数组列表。
ASP[1].net外文翻译
外文文献译文是什么?是一个能在规划好框架的服务器上建造强大的网络应用。
提供几个重要的优于以前的网络发展模型之处:"增强的性能。
能在服务器上编译普通语言运行环境不象它的解释前人能利用早的结合、just-in-time编辑,本国的最佳化,贮藏箱的全然的服务。
Unlike its interpreted predecessors, can take advantage of early binding, just-in-time compilation, native optimization, and caching services right out of the box.这数量对戏剧性地较好的性能在你曾写一排密码之前。
"世界第一流水平的工具支持。
的骨架在在视力的电影制片厂整体的发展环境方面的个有钱的工具箱和设计者旁是与补体连结的。
所见即所得编辑、drag-and-drop服务员控制和自动的使用是刚才一特征很少这个强大的工具提供。
"力和柔性。
因为运行时间以普通的语言为基础,完全的台是对网应用启发者有用的力和柔性。
净的骨架类图书馆,通知,数据通道解法从网全部是无缝地可以接近的。
也是语言独立的,因此你能选择语言最好地适用于你的应用或横过许多语言瓜分你的应用。
更多地,普通的语言运行时间相互操作性保证你的现存的对根据COM发展的投资当到移时保存。
"简单性。
使从对使用和地点外形的简单的形式屈服于和顾客证实做普通的任务是容易的。
例如,的页骨架允许你建造使用者界面从表演密码的干净分离的应用逻辑并触摸事件在一简单的,可视化Basic如同形式处理模型。
另外,普通的语言运行时间简化发展,同管理密码服务像自动的提及计算和垃圾收集。
"可管理性。
雇用一个根据正文、hierarchical外形系统,这简化应用对你的服务员环境和网应用安置。
因为外形消息是作为清楚的正文贮藏,新的安置可能没有地方的管理工具的帮助被适用。
- 1、下载文档前请自行甄别文档内容的完整性,平台不提供额外的编辑、内容补充、找答案等附加服务。
- 2、"仅部分预览"的文档,不可在线预览部分如存在完整性等问题,可反馈申请退款(可完整预览的文档不适用该条件!)。
- 3、如文档侵犯您的权益,请联系客服反馈,我们会尽快为您处理(人工客服工作时间:9:00-18:30)。
外文原文翻译: C#版ASP(动态服务器主页)是一种较新的技术,它已经过几个阶段的发展(进化).它是怎么诞生的呢?在七年前,它作为一种简单的方法来往普通网页里添加动态内容。
自从那时以后,它的发展势头强劲:作为高级网页程序的开发平台,包括:电子商务网站、基于事件驱动的门户网站和你在网上能看到的其他所有东西。
2.0 是ASP的最新版本,而且拥有最让人激动的更新。
在帮助下,在网络编程时,开发者不再把一大堆HTML源码和脚本代码杂乱地放在同一页面上。
你可以完全使用代码和工具(Visual Studio 2005)来创建网页程序。
这些创新的代价仅仅是多学一些东西。
你要学一些高级开发工具(Visual Studio)和工具包(the .NET Framework),而且你需要精通一门编程语言,如C#。
网络发展的演化因特网是在1960年末在试验中诞生的。
它的目标是:建立一个真实的、有弹性的信息网络——可以经受的起若干数量的电脑的崩溃,而不至于阻断其他电脑的正常通信。
经得起潜在的重大灾难(如核武器攻击)。
美国国防部提供了刚开始的研究基金。
最早的因特网局限在教育机构和从事国防的单位。
它因为作为学术研究的一种工具而繁荣,它让全球的研究人员可以彼此共享信息。
到了1990初,伟大的“猫”诞生了,它通过电话线工作,从此,因特网向商业用户打开了大门。
在1993年,第一个HTML浏览器诞生了,标志着因特网革命的到来。
我们很难把最早的网页称为网页序。
第一代的网页看起来更像小册子:主要由固定的H TML页面构成,这些也都需要手动修改。
一个简单的HTML页面有点像一个字处理文档——它包含了格式化的内容,可以在你的电脑上显示,但是并不完成其他任何功能。
上面的就是一个最简单的例子,文档包括头信息和单行文本。
一个HTML文档有两种类型的内容:文本和标记(告诉浏览器如何格式化)。
这些标记很容易辨认,因为它们总是出现在< 和 >之间。
HTML定义了不同级别的标题、段落、超链接、斜体和粗体格式、水平线等。
举个例子:<h1>某个文本<h1>,告诉浏览器用标题1的格式来显示这个文本,就是用最大的黑体字来显示。
图1-1显示了这个页面在浏览器中的效果。
提示:你不需要精通HTML就能进行A 网页编程,虽然它(HTML)是很有用的。
为了快速介绍一下HTML,给大家介绍一个网上的优秀HTML指南。
HTML 2.0 首次引入了一个网页编程的新技术,称为HTML表单。
HT ML表单扩展了HTML的功能,不仅包含了格式化标签,而且包含了窗体小部件或者叫控件。
这些控件包含了普通的功能部件,如下拉列表、文本框和按钮。
下面是一个由HTML表单控件创建的网页。
网页表单允许网页程序设计师设计标准的输入页面。
当用户单击图1-2的提交按钮,所有在输入控件中的数据(在这个例子中是两个复选框)将打包成一个长字符串,接着发送到服务器。
在服务器端,一个客户程序接收和处理这些数据。
令人惊奇的是:这些为HTML表单创建有超过十年之久的控件仍然是你用来创建页面的基础。
不同的是这些程序控件将运行在服务器端。
在过去,当用户单击一个表单页面的按钮时,信息要通过e-mail来发送或者使用在服务器端运行的程序(通过CGI标准)。
今天,你将可以使用更强大、更优雅的平台。
理解的创建原因可以帮助我们了解其他网页开发技术遇到的问题。
在原始的CGI标准下,举个例子,网页服务器必须为每个网页请求建立一个单独的程序实例。
如果这个网页很受人们欢迎(那访问者将很多),那么网页服务器就要经受得起数以百计的独立程序副本,这样最终导致服务器反而因为受欢迎而成为受害者。
为了解决这个问题,微软开发了ISAPI(网络服务程序编程接口),一个高层次的编程模型。
IS API解决了性能问题,但是付出了复杂性的代价。
即使ISAPI开发者是个C+编程老手,他仍然晚上担心到失眠,因为会遇到多线程处理这样让人麻烦的问题。
ISAPI编程是给那些坚强的“夜猫子”,不是给那些懦弱的人。
ISAPI并没有真正消失,取代它的是,微软利用它建立了一个更高级的开发平台,如ASP 和 。
这两种技术都可以使开发者编写动态网页,而不需要担心底层的执行细节。
由于这个原因,这两个平台成功到令人难以置信。
最初的ASP平台吸引了将近一百万的开发人员。
当第一次发布时,作为.NET Framew ork的核心部件受到人们更多关注。
事实上, 1.0已经在数十个大型商业网络中得到应用,虽然它还在最后的测试阶段。
虽然拥有类似的基础,ASP 和有根本的不同。
ASP是基于脚本的编程语言,需要全面理解HTML,而且还要经过一大堆痛苦的编程训练。
而,在另一方面,是面向对象的编程模型,建立网页页面就像建立桌面程序一样容易。
在很多方面,学会比精通ASP要容易,而且功能更加强大。
同时,服务器端的网络发展为从技术的字母形花片汤到广受欢迎的一类编程开发人员开始试着使用嵌入多媒体、JavaScript的小程序、DHTML和Java代码来增强网页的功能。
这些基于客户端的技术不需要通过服务器的处理就能实现。
所有的程序都(从服务器)下载到客户端浏览器,在本地执行。
客户端技术的最大问题就是它们不被所有的浏览器和操作系统完美的支持。
其中的一个原因就是网络开发太受欢迎了,首先是网络程序不需要通过CD安装、下载和其他单调的配置。
取而代之的是,一个网络程序只要能上网的电脑就可以执行了。
但是,一旦开发者使用客户端技术,他们就会遇到一些常见的问题:比如跨浏览器的兼容性。
开发者就不得不在不同的浏览器和操作系统中测试他们的网页,甚至他们还要给用户发布浏览器更新。
换句话说,客户端模型牺牲了网络程序最重要的优良特性。
由于上述原因,被设计为服务器端技术。
所有的代码都在服务器上执行。
当代码执行完毕时,用户就会得到一个普通的HTML页面,这样任何浏览器都可以浏览了。
图1-3显示了服务器端和客户端模型的不同。
这里还有几条原因要避免客户端编程:孤立性:客户端代码无法访问服务器资源。
举个例子,没有一种简单的方式让客户端可以读取一个在服务器上的文件或进行数据库连接。
(至少不会遇到安全性和浏览器兼容性的问题)安全性:最终用户可以查看客户端代码。
一旦有不怀好意的用户理解了程序是怎么工作的,他们就有可能乱来了。
在某些方面,允许你通过服务器端编程结合最佳的客户端编程。
举个例子:控件可以智能侦测客户端浏览器的属性。
如果该浏览器支持JavaScript,那么这些控件将返回一个含有JavaScript的更多功能的页面。
尽管如此,不管浏览器的功能有多强大,你的代码始终在服务器端执行。
状态限制:为了保证最佳性能,网络设计成无状态的协议。
意思就是:一旦页面已经传送给用户,连接就关闭了而且用户指定的信息也被丢弃了。
ASP包括一个ses sion state(会话状态)特性允许程序员来解决这个问题。
使用session state,一个网页程序可以为每一个客户端暂时保存信息(保存在服务器的内存里)。
尽管如此,如果一个网站是放在几个服务器上,session state就无能无力了。
在这种情况下,一个客户要访问B 服务器,而他的会话信息是被A服务器保留的,这样实际上这个会话信息将被丢弃掉。
ASP. NET纠正了这个问题,允许把状态储存在中央仓库,就像一个单独的进程或者一个所有服务器都可以访问的数据库。
通过引进全新的模型解决了上述问题(当然不止这些啦)。
这个模型是基于一个伟大的技术,称之为.NET Framework。
你应该知道的是:.NET Framew ork是几种技术的群集(集合)。
.NET语言:包括C#、(Visual Basic .NET一种面向对象的、现代化的语言(VB 6.0的继任者);这些语言还包括:(服务器端版本的JavaScript,J#(java的兼容产品),还有C ++管理扩充。
CLR(公共语言运行库):CLR是执行所有.NET程序和为这些程序提供自动服务的引擎,如安全验证、内存管理和优化等。
.NET Framework类库:类库包含了成千上万个已经预建好的函数,你可以在你的程序中嵌入它们。
这些众多属性有时也被成为一个技术集,如(用来创建数据库程序的技术)和Windows Forms(也是一种技术,用来创建基于桌面的用户界面程序)。
:这是一种主机网页程序和网络服务的引擎,从. NET类库中包含了几乎所有特性。
还包含了网页特有的服务。
Visual Studio:这个可选的开发工具包含了众多提高效率和调试功能的特性。
VS的安装CD(或DVD)包含了完整的.NET Framework,所以你不需要额外下载它。
有趣的是,C#和比C#和Java 要相似多了(或者是VB6和)。
虽然语法是不同的,但是C#和都使用.NET 类库,也都由CLR支持。
事实上,几乎所有的C#代码块都可以一行一行翻译成的代码块。
当然也有不行的时候(如:C#语言支持一种属性叫调用匿名方法,而不支持)。
但是对绝大部分来说,只要开发者学会了其中一个.NET语言,就可以很快学会另一种。
简而言之,C#和都是一流的,现代的用来开发下一代网络程序的语言。
.NET 1.0引进了一种全新的语言。
尽管如此,.NET 2.0语言的变化还是细微的。
C# 2005和VB2 005都添加了一些新的特性,但是这些语言绝大部分都没有变化。
因此,任何使用C#1.0编写的代码都可以同样的在2.0下运行。
在第二、三章,就会学到C#语法和面向对象编程的基础。
搞定了这些基础,你就可以开始创建简单的网页了。
这样你就会少点困惑,学得更快。
(向一些高级话题进军,如数据库访问和网络服务)CLR(公共语言运行库)只能运行IL代码,这就意味着它根本不知道你的源代码是用哪一个语言编写的,尽管如此,CLR竟然完成了另外一个编译步骤——它接受了IL代码并把它转换成适合当前平台的本机机器语言。
这个步骤在程序启动时发生,而且在代码被真正执行之前。
在程序中,当网络程序正在运行时,这些特定机器文件存储在高速缓存中,所以它们可以被复用(重新使用),以确保最佳性能。
你或许会问.NET为什么不直接编译成机器语言。
原因是:机器代码取决于多个因素,包括CPU。
举个例子,如果你是为一台含有Intel 处理器的电脑而创建的机器代码,那么编译器将能够使用超线程技术来增强你的代码。
这种适用特点机器的版本并不适合在其他电脑中运行,因为你无法保证它们使用同样的处理器。
在VS 2005中,另一个受人欢迎的改变是支持不同的编码模型。
而VS2003却受那个困扰,VS 2005支持某个范围的不同编码模型,使它成为具有灵活性、通用性我的设计工具。
这就让你可以把HTML标签和事件处理代码放在同一个文件内或者分开存放,而不用委屈的使用VS,这样可以享受有用的特性好处,如代码智能完成。