Thinking on the design of ASP. WebForm

Source: Internet
Author: User
Tags html notes php script

I've been developing Web applications using the ASP. WebForm framework for almost four years, and throughout my development career, I've used the MVC framework of ASP. Because there is often a discussion on the WebForm framework and the MVC framework of the pros and cons, so they are also concerned about the two, because they are most familiar with the WebForm framework, so will consider its advantages? What is the design idea?

To understand the design idea of ASP, we must consider its generation, the technical basis, and the characteristics and ideas of other dynamic Web-page technologies in the same era.

The first is to generate the technical basis of ASP, the following quoted Baidu Encyclopedia:

"In 1996, the ASP 1.0 (Active Server Pages) version appeared, which caused a new revolution in web development and reduced the difficulty of dynamic web development. Previously developed dynamic Web pages need to write a lot of complex C code, programming efficiency is very low, and Web page developers need to master very high programming skills. Instead, ASP uses a simple scripting language that embeds code directly into HTML, making it easier to design Web pages. Although the ASP is very simple, it is able to achieve very powerful functions, all thanks to its components. In particular, ADO components make it easy to access a database in a Web page. All this has driven the rapid development and construction of dynamic Web pages, while making the ASP get popular quickly.

In 1998, Microsoft released ASP 2.0, which was provided as part of the Windows NT 4 Option pack. The main difference between ASP 2.0 and ASP 1.0 is that external components can be initialized, so that all components have separate memory space and can be transacted. Built-in Microsoft Transaction Server (MTS) makes it easier to make components. In June 2000, Microsoft announced its own. NET Framework: The basic idea of the NET Framework is to transfer the original focus from a single website or device connected to the Internet to computers, devices, and service groups, and the Internet itself as the basis for a new generation of operating systems. In this way, users will be able to control the way information is delivered, time and content, thus getting more services. 2001, ASP. NET surface. It was originally named Asp+, and was later changed to ASP. Asp. NET is a Web runtime environment built on. NET, developed by Microsoft, which is not a simple upgrade of ASP, but a new generation of active Server Pages. Asp. NET is part of Microsoft's new architecture Microsoft.NET, with a new technology architecture that makes programming easier. With ASP. NET, you can create a content-rich, dynamic, and personalized Web site. Asp. NET easy to learn, powerful, flexible application, good extensibility, you can use any. NET compatible language. [4-5] 2002 Microsoft released. NET version. NET Framework 1.0, where the ASP version is ASP. 1.0, which previously released two. NET test versions Betal and BETA2. In 2003, Microsoft released the. NET FRAMEWORRK 1.1 release, where the ASP version is ASP. 1.1. in 2005, Microsoft released the official version of the. NET Framework 2.0, which is ASP. 2.0. "This is a quote from the Baidu Encyclopedia, the introduction of the development from ASP to ASP." Read the narrative that you should realize that ASP. NET is developed from asp1.0, but it is not directly from ASP to ASP, first is asp1.0, then asp2.0, then asp+, then renamed to ASP. NET (here, if you look at it separately, this is the two words, because another big project in the ASP's development process. NET appeared, why. Net appeared, not in the scope of the discussion, can self-Baidu).    The web framework for asp.net1.1 technology is WebForm.    Although I do not intend to comb the production and development of. NET, the production of ASP. NET WebForm is very close. In the first two years of ASP production, there was another very famous Dynamic Web page technology, that is PHP. The concept of PHP is quoted here: "PHP (Foreign name: Php:hypertext Preprocessor, Chinese name:" Hypertext Preprocessor ") is a common open source scripting language. The grammar absorbs the C language, Java and Perl features, is conducive to learning, widely used, mainly for the field of web development. PHP's unique syntax mixes the syntax of C, Java, Perl, and PHP's own creation. It can execute Dynamic Web pages more quickly than CGI or Perl. Dynamic pages made in PHP are compared to other programming languages, and PHP is executed in HTML (an application under the standard Universal Markup Language), which is much more efficient than CGI, which generates HTML markup entirely; PHP can also execute post-compilation code, Compilation can achieve encryption and optimize code execution, making code run faster. "PHP is produced earlier than ASP technology, ASP should be absorbed with the construction of PHP technology, the reason is called the construction, because the starting point of PHP is very low, and has not been fully designed, it is a small tool developed rapidly. Here also want to mention another important dynamic Web technology, again quoted Baidu Encyclopedia: "" The full name of the JSP is Java Server Pages, the Chinese name Java Servers page, which is simply a simplified servlet design, it [1] is advocated by Sun Microsystems Company, many companies involved in the establishment of a dynamic Web technology standards. JSP technology is a bit like ASP technology, it is in the traditional Web page HTML (standard Common Markup Language subset) file (*.htm,*.html) inserted Java program segment (scriptlet) and JSP tag (tag), thereby forming a JSP file, suffix named (*.jsp). Web applications developed with JSP are cross-platform and can run on Linux and other operating systems. it implements the Java extension in HTML syntax (in <%,%> form). JSP, like a servlet, is executed on the server side. Usually returned to the client is an HTML text, so the client can browse as long as there is a browser. JSP Technology uses the Java programming language to write tags and scriptlets of class XML to encapsulate the processing logic that produces dynamic Web pages. Web pages can also access the application logic of resources that exist on the server through tags and scriptlets. JSP separates the Web page logic from the display of the web design, supports reusable component-based design, and makes the development of Web-based applications quick and easy. JSP (JavaServer pages) is a dynamic page technology whose main purpose is to separate the presentation logic from the servlet. Java servlet is the technical foundation of JSP, and the development of a large Web application requires Java servlet and JSP mates to complete. JSP has the simple and easy-to-use Java technology, completely object-oriented, platform-independent and safe and reliable, mainly for the internet all the characteristics. "JSP technology is much later than PHP, ASP technology, and JSP technology is now being used to develop very large web sites, but not because the JSP technology itself is very good, but because it is generated on top of Java." This era of ASP, PHP, JSP and other dynamic Web technology, there is a common point is that you visit the URL address, there must be a such a file exists. ASP is the technical basis for ASP, so the WebForm framework of ASP. NET is a logical use of the same idea. The WebForm page file has two parts, the suffix name is. aspx and. Aspx.cs. This is different from ASP, ASP page file only one, suffix name is. asp.   From. asp to. aspx we can see that ASPX is added to the ASP after the X-letter, Lenovo Microsoft's other products,. docx instead of. xls, and how much can be spied on by Microsoft for the technical upgrade of the naming thinking. As described above, the ASP. NET WebForm split the paging file into two parts. This is a big improvement, the improvement is to solve some problems (not one, a series of problems). Improved ASP technology CS code and HTML are mixed together, exposing the code details, ASP pages will not be compiled into DLLs.   There are other advantages as well. From ASP to ASP, there is a large number of built-in ASP. NET server controls in the WebForm framework, which is a big change, with three types of server controls:
    • HTML server Controls-Traditional HTML tags
    • Web server Controls-new ASP.
    • Validation server controls-for input validation

Some people on the web say that this is to solve the problem of developing an ASP page that will cause spaghetti. My understanding of server controls has changed much more than that, If you create a page with a pure server control (ASP. Soon, many people do not recommend this, as for why, I know will generate a lot of viewstate string, of course, there are other reasons), and then the page elements to operate, with the use of proficiency, you may realize that the WebForm page file is not in the HTM L-Characters in the middle of the puzzle, or not in a heap of servers can not understand the middle, dynamic generation of some characters. It goes a lot of steps, it puts all the HTML notes of the page, after the page engine processing, into a flexible class, the program developers can manipulate these tag classes at will, and then at a suitable time, then the class sequence of "ToString ()" into a string, to the page. Invented the server control technology, the author's thought source may be the desktop application development technology, from DOS operating system (command line interaction), to the Windows operating system (mainly mouse click, keyboard key interaction), the development of desktop applications, will use a lot of control technology, control multiplexing technology can greatly improve the development efficiency. Why guess the author's ideas may come from this, because when ASP technology appears, when the desktop application development or mainstream, the author may dip in this atmosphere, the design of desktop application development ideas to the development of web programs. Here to elicit another thing, is the event-driven, casually create a new ASPX page, the most important thing is the event processing method, Page_Load. The extensive use of event-driven in the Windows operating system is based on the event-driven model. Then the author uses event-driven in WebForm, and may have borrowed from windows.

Whether it is a server control, or event-driven, these two (or one, because controls and events are related to each other) design ideas have a big impact on the WebForm framework and the way Web applications are developed. Server Control plus event driver although it is beneficial to develop a management system-based Web program, but does not conform to the operation of the Web application itself, this is criticized by many people, the Web program because it does not run in the desktop operating system, the earliest time it can not even interact, just to facilitate the exchange of information, Used only to display information. The Web program essentially works by sending a request-processing command to the Web server through a browser, a web-managed program that receives the request command, takes action, and then returns the processing result (the result may be an article, or it will tell you that the article was deleted successfully, or that the content of the information you raised was saved). WebForm easy to misunderstand it runs in the operating system or the browser, all code executes on the client. Although now the browser can actually put the dynamic page in the browser side to execute, but the WebForm page actually has the server-side program processing.

If we want to evaluate and examine the design idea of WebForm framework, we have to compare with another framework idea, that is the design idea of MVC framework (model). The invention of the MVC model may not be deliberately designed, but rather a deep thought of things, and then the product of nature. The MVC model is to deal with the problem clearly and reduce the coupling.

Because there is no PHP and JSP can not compare these two technologies, actually want to pull them in contrast, especially JSP technology, because Java cross-platform, JSP design will not have too many Windows shadow, Windows often do not want to tell you the complex truth, So I'm going to wrap you up with a simple world to give you the feeling, and then as you grow, this early packaging could be a big burden, or the Microsoft stuff has too much Windows shadow, too around windows.

Finally, if you let go of your nervous nerves, do not set limits, random associations, casual design, but to consider the perfect, you will feel the Web technology to develop some ideas of inheritance and transformation. From the simple HTML plain text display, the invention of the text browser, the HTTP protocol 0.9 behind, to the image display, the invention of LiveScript (that is, JavaScript), to the CGI program, then to the servlet splicing HTML technology, to the PHP script, To the ASP dynamic page technology, to the JSP dynamic page technology, to the Webfrom framework, the Spring framework, the MVC framework behind these techniques there is a thought in series. The invention of a thing is not accidental, often has a humble beginning.

Read this article note that if you feel confused, then don't read the references, you can read the rest of the content first. This article does not carry on the careful investigation and the examination, some places may be wrong, some technology's invention may also not be accurate. But hope that the text will pay attention to a technical development history of ideas, can give you a little help to learn.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.