Problem solve Get help with specific problems with your technologies, process and projects.

Moving from ASP to ASP.NET

An overview of the key improvements made to the .NET version of ASP.

Let other users know how useful this tip is by rating it below. Got a tip or code of your own you'd like to share? Submit it here.

ASP can only be scripted using the basic non-typed languages such as VBScript and JScript (unless you install a separate language interpreter). While ASP does parse and cache the code for the page the first time it is executed, the limitations prevent more strongly-typed languages like Visual Basic and C++ from being used where this would be an advantage. ASP.NET provides a true language-neutral execution framework for Web applications.

It is also very easy to create huge ASP pages containing spaghetti-like mixture of code, HTML, test, object declaration, etc. And it's hard to re-use code unless you place it in separate include files -- not the best solution. In many environments, developing a Web application utilizes the skills of a wide range of professionals. For example, you have programmers writing the code and designers making the HTML look good. Having both the code and the content intermixed in a single file that both of these groups need to operate on makes it difficult for them to work together. ASP.NET allows true separation of code and content.

In the previous version of ASP, you have to write code to do almost anything. Want to maintain state in the form fields? Write code. Want to validate data entered on the client? Write code. Want to emit some simple data values? Write code. ASP.NET introduces a real component model, with server-based controls and an event driven execution model paradigm, similar in concept to the way that a Visual Basic form works now. The new ASP.NET server controls are declarative (i.e. you only have to declare them in order to get them to do something), so you actually write less code -- in fact, in many situations you dont have to write any code at all!

What benefits do I get using ASP.NET over traditional ASP?

Compiled: The .NET Framework detects that the page is being run for the first time and compiles it, storing the copy of it. In the traditional approach to ASP, pages were interpreted on each request to the page.

State management: As Internet is stateless, to manage state between pages, a programmer used to have to write code to maintain the values in the page. ASP.NET offers built-in features for state management.

Strongly typed: In traditional ASP, programmers were provided with only variant datatype, consuming more memory and not providing ways for early binding -- something that is now possible with ASP.NET.

Any .NET language: ASP.NET allows you to use the features of other powerful languages in your ASP.NET pages. A language, which follows the CLS (Common Language Specification), can be used in ASP.NET pages. Even languages as remote as COBOL can be used to script a ASP.NET page.

Web Forms: Web Forms provide a rich UI of the pages in ASP.NET.

Web service: A programmable application component accessible via standard Web protocols.

Control-based event-driven model provided by ASP.NET makes it easy to create powerful applications similar to VB applications.

Separate code and presentation: ASP.NET provides a powerful technique called code behind. which allows you to separate code from presentation.

No registry: This allows deployment by simply copying the files, without having to bother with registry issues.

Caching features: Pages, and even parts of pages, frequently requested can now be cached for better performance.

Validation controls and server controls: For common validation a programmer used to have to write code. This was difficult if there were different client types for your page. So a set of server controls, along with validation controls, render the HTML, which is specific to the client. The programmer can even build several powerful controls based on their specific needs.

No DLL locking: In the previous versions of ASP, when the script used the functions, the DLL was locked in the memory. With ASP.NET, the Framework detects the new version and replaces the old one without flushing the server.

Debugging features: In ASP, debugging an application was very difficult. ASP.NET provides several debugging and tracing features.

Dig Deeper on ASP.NET development best practices

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.