asp.net和PHP
除了這些逐步解說之外,Visual Studio 文件中的許多主題章節,都包含重要功能的逐步解說。
以下為英文原版教程。
ASP.NET is a Web application framework developed and marketed by Microsoft to allow programmers to build dynamic Web sites, Web applications and Web services. It was first released in January 2002 with version 1.0 of the .NET Framework, and is the successor to Microsoft's Active Server Pages (ASP) technology. ASP.NET is built on the Common Language Runtime (CLR), allowing programmers to write ASP.NET code using any supported .NET language. The ASP.NET SOAP extension framework allows ASP.NET components to process SOAP messages.
Contents
[hide]
* 1 History
* 2 Characteristics
o 2.1 Pages
o 2.2 Directives
+ 2.2.1 Examples
# 2.2.1.1 Inline code
# 2.2.1.2 Code-behind solutions
o 2.3 User controls
o 2.4 Custom controls
o 2.5 Rendering technique
o 2.6 State management
+ 2.6.1 Application
+ 2.6.2 Session state
+ 2.6.3 View state
+ 2.6.4 Server-side caching
+ 2.6.5 Other
o 2.7 Template engine
o 2.8 Other files
o 2.9 Directory structure
* 3 Performance
* 4 Extension
* 5 ASP.NET compared with ASP classic
* 6 Criticism
* 7 Development tools
* 8 Frameworks
* 9 Versions
* 10 Other implementations
* 11 Notes
* 12 References
* 13 Further reading
* 14 External links
[edit] History
After the release of Internet Information Services 4.0 in 1997, Microsoft began researching possibilities for a new Web application model that would solve common complaints about ASP,
With the move to the Common Language Runtime, XSP was re-implemented in C# (known internally as "Project Cool" but kept secret from the public), and the name changed to ASP+, as by this point the new platform was seen as being the successor to Active Server Pages, and the intention was to provide an easy migration path for ASP developers.[4]
Mark Anders first demonstrated ASP+ at the ASP Connections conference in Phoenix, Arizona on May 2, 2000. Demonstrations to the wide public and initial beta release of ASP+ (and the rest of the .NET Framework) came at the 2000 Professional Developers Conference on July 11, 2000 in Orlando, Florida. During Bill Gates' keynote presentation, Fujitsu demonstrated ASP+ being used in conjunction with COBOL,[5] and support for a variety of other languages was announced, including Microsoft's new Visual Basic .NET and C# languages, as well as Python and Perl support by way of interoperability tools created by ActiveState.
After four years of development, and a series of beta releases in 2000 and 2001, ASP.NET 1.0 was released on January 5, 2002 as part of version 1.0 of the .NET Framework. Even prior to the release, dozens of books had been written about ASP.NET,[7] and Microsoft promoted it heavily as part of its platform for Web services. Guthrie became the product unit manager for ASP.NET, and development continued apace, with version 1.1 being released on April 24, 2003 as a part of Windows Server 2003. This release focused on improving ASP.NET's support for mobile devices.
[edit] Characteristics
[edit] Pages
ASP.NET Web pages, known officially as Web Forms,[8] are the main building block for application development.[9] Web forms are contained in files with an ".aspx" extension; these files typically contain static (X)HTML markup, as well as markup defining server-side Web Controls and User Controls where the developers place all the required static and dynamic content for the Web page.
[edit] Directives
A directive is special instructions on how ASP.NET should process the page.[11] The most common directive is <%@ Page %> which can specify many attributes used by the ASP.NET page parser and compiler.
Programmers can also build custom controls for ASP.NET applications. Unlike user controls, these controls do not have an ASCX markup file, having all their code compiled into a dynamic link library (DLL) file. Such custom controls can be used across multiple Web applications and .
[edit] Rendering technique
ASP.NET uses a visited composites rendering technique. During compilation, the template (.aspx) file is compiled into initialization code which builds a control tree (the composite) representing the original template. Literal text goes into instances of the Literal control class, and server controls are represented by instances of a specific control class. The initialization code is combined with user-written code (usually by the assembly of multiple partial classes) and results in a class specific for the page. The page doubles as the root of the control tree.
After the request has been processed, the instance of the page class is discarded and with it the entire control tree. This is a source of confusion among novice ASP.NET programmers who rely on class instance members that are lost with every page request/response cycle.
ASP.NET applications are hosted by a Web server and are accessed using the stateless HTTP protocol. As such, if an application uses , it has to implement state management on its own. ASP.NET provides various functions for state management. Conceptually, Microsoft treats "state" as GUI state. Problems may arise if an application needs to keep track of "data state"; for example, a finite-state machine which may be in a transient state between requests (lazy evaluation) or which takes a long time to initialize. State management in ASP.NET pages with authentication can make Web scraping difficult or impossible.
4.4.9 2008-08-07 Security enhancements and bug fixes. The last release of the PHP 4.4 series.[33][34]
5 5.0.0 2004-07-13 Zend Engine II with a new object model.[35]
5.1.0 2005-11-24 Performance improvements with introduction of compiler variables in re-engineered PHP Engine.[35] Added PHP Data Objects (PDO) as a consistent interface for accessing databases. [36]
5.2.0 2006-11-02 Enabled the filter extension by default. Native JSON support.[35]
5.2.17 2011-01-06 Fix of critical vulnerability connected to floating point.
5.3.0 2009-06-30 Namespace support; Late static bindings, Jump label (limited goto), Native closures, Native PHP archives (phar), garbage collection for circular references, improved Windows support, sqlite3, mysqlnd as a replacement for libmysql as underlying library for the extensions that work with MySQL, fileinfo as a replacement for mime_magic for better MIME support, the Internationalization extension, and deprecation of ereg extension.
5.3.1 2009-11-19 Over 100 bug fixes, some of which were security fixes.
5.3.2 2010-03-04 Includes a large number of bug fixes.
5.3.3 2010-07-22 Mainly bug and security fixes; FPM SAPI.
5.3.4 2010-12-10 Mainly bug and security fixes; improvements to FPM SAPI.
5.3.5 2011-01-06 Fix of critical vulnerability connected to floating point.
5.3.6 2011-03-10 Over 60 bug fixes that were reported in the previous version.
5.3.7 2011-08-18 This release focuses on improving the stability of the PHP 5.3.x branch with over 90 bug fixes, some of which are security related.
5.3.9 2012-01-10 This release focuses on improving the stability of the PHP 5.3.x branch with over 90 bug fixes, some of which are security related.
5.3.10 2012-02-02 Fixed arbitrary remote code execution vulnerability reported by Stefan Esser, CVE-2012-0830.
5.4.0 2012-03-01 Trait Support, short array syntax support. Removed items: register_globals, safe_mode, allow_call_time_pass_reference, session_register(), session_unregister() and session_is_registered(). Several improvements to existing features, performance and reduced memory requirements.
6 ?.? No date set The development of PHP 6 has been delayed because the developers have decided the current approach to handling of instance unicode is not a good one, and are considering alternate ways in the next version of PHP. The updates that were intended for PHP 6 were added to instead.
Beginning on June 28, 2011, the PHP Group began following a timeline for when new versions of PHP will be released.[37] Under this timeline, at least one release should occur every month. Once per year, a minor release should occur which can include new features. Every minor release should at least have 2 years of security and bug fixes, followed by at least 1 year of only security fixes, for a total of a 3 year release process for every minor release. No new features (unless small and self contained) will be introduced into a minor release during the 3 year release process.
[edit] Usage
PHP is a general-purpose scripting language that is especially suited to server-side Web development where PHP generally runs on a Web server. Any PHP code in a requested file is executed by the PHP runtime, usually to create dynamic Web page content or dynamic images used on Web sites or elsewhere.[38] It can also be used for command-line scripting and client-side GUI applications. PHP can be deployed on most Web servers, many operating systems and platforms, and can be used with many relational database management systems (RDBMS). It is available free of charge, and the PHP Group provides the complete source code for users to build, customize and extend for their own use.[3]
PHP acts primarily as a filter,[39] taking input from a file or stream containing text and/or PHP instructions and outputting another stream of data; most commonly the output will be HTML. Since PHP 4, the PHP parser compiles input to produce bytecode for processing by the Zend Engine, giving improved performance over its interpreter predecessor.