From ASP to asp.net: Migrating the user interface

Source: Internet
Author: User
Tags implement classic asp client advantage

Experience has shown that migrating the user interface (UI) from ASP to ASP.net will improve 50~80% performance. Half the reason for this result is that for most well-designed applications, the only thing that has not been natively compiled is the UI. The business and data-tier components are already compiled Dll,ui call these DLLs through a COM interface. Because. NET Framework provides good interoperability with existing COM objects, it is more reasonable to migrate only the ASP-based UI layer into asp.net.

But in addition to the benefits of compiling and COM interoperability, there are several other advantages:

asp.net UI model

If the developer had previously integrated visual Notepad and Visual InterDev for editing, it would soon be attracted to the ASP.net's excellent UI-building model after touching the ASP.net interface. Microsoft has significantly shortened UI development time by implementing a new Web page and control model and simulating VB6 development thinking patterns. The Web page model simulates the Windows Messaging model and breaks it down into two parts of the Web client and Web server. More importantly, ASP. NET server controls give developers a VB6-style form function that automatically manages the required state without the need for developer intervention. The end result is that developers can develop a much more reliable UI in much less time.

Asp. NET also provides a large number of predesigned controls and provides a framework to hold them. These controls include a TextBox, Calendar, Drop-down List Box, TreeView, TabControl, and so on. server controls provide functionality similar to ActiveX controls, but they do not require the same level of client configuration or permissions. Note that instead of executing binary code on the client, it executes on the server and generates HTML output for use by the client browser. In addition, if the browser supports it, you can also generate a combination of HTML and JScript that allows forms to be executed on the client, minimizing the round trips that Web applications produce.

To upgrade an existing ASP form to asp.net, you need to load the HTML code into a new ASP.net form, manipulate the HTML source code, and turn the control into a server control. If you have a large number of scripting code in your form and you take advantage of the Visual InterDev Designer, it is easier to run your ASP application and then select View | source files in your browser, cut and paste HTML, and load the basic form into asp.net.

Extensible UI Model

To really play the asp.net advantage, you should not only copy HTML code from an existing ASP application, but also use ASP.net's code reuse capabilities by defining a Web page element as a reusable control. With the scalability of the ASP.net UI model, you can group common functions and use new page base classes, user controls, and Web server controls to implement new ASP.net Web pages and replace the original ASP Web pages. For example, one of the most difficult problems that a company user can solve when using an ASP application provided by different departments of the company is how to cope with a variety of UI models.

If your company intends to migrate to ASP.net, our first recommendation is to replace the self-designed menu and navigation system with an internal asp.net implementation of the page class and user control, or as a standard navigation implementation of a Third-party component vendor.

For third-party navigation systems, be aware of the option provided. NET source code, in order to establish its own internal navigation standards. By reusing this implementation in all ASP.net systems, your users will have access to a unified navigation mechanism. In addition, you can significantly reduce the number of navigational code that is written for future systems.

Other benefits of UI migration

In addition to the benefits of the UI development model, you should take full advantage of the ASP.net cache and session state mechanism. Developers need only a small amount of work, you can use the ASP.net output caching mechanism, to significantly improve the performance of the Web page load. If you need to cache individual objects, or if you want to carefully control the caching mechanism of the web, you can use the built-in cache API for more explicit cache control.

Unless you implement your own proprietary state management mechanism, the classic ASP-built session state management does not allow applications to be extended beyond the scope of a single machine. While my recommendation for session management stays the same-don't use it unless absolutely necessary-the mechanism for making session state across multiple front-end servers is built into asp.net. You can use a single state server that stores the state of a set of Web servers in its own memory, or it can store the state on a common SQL Server backend. Whichever mechanism you choose requires a simple change in your local web.config file. Based on my experience with both mechanisms, it is recommended that you store state data in SQL Server to maximize availability and reliability, as out-of-process state servers do not provide significant performance benefits.




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.