Search This Blog

Oct 28, 2012

Differences Between ASP and ASP.NET

ASP.NET isn't simply the next version of ASP it's a completely redesigned technology that takes the best aspects of ASP and merges them with the power of pure object-oriented programming (OOP), a powerful development framework, to give it a vast range of functionality and the advantages of a fully compiled execution environment. Because the changes between ASP and ASP.NET are so drastic, current ASP developers must "unlearn" many concepts that they became accustomed to in ASP in order to truly get the most out of ASP.NET.

Compiled Environment

One of the most dramatic changes in ASP.NET is that it's now a fully compiled environment. Microsoft has implemented this very intelligently and it would be very easy to dismiss ASP.NET as interpreted because, to the programmer and the end user, it appears as if ASP.NET works in exactly the same way as ASP: You modify your ASP.NET page, you refresh the page in the browser, and the changes are reflected. Nowhere are you required to run a compiler. Compilation actually occurs the first time a page is requested after it has been modified. This compiled copy is then kept until the page is modified and requested again. As I've already mentioned, this process is totally transparent to the user.

There's naturally a significant performance advantage of ASP.NET over ASP now, in addition to the obligatory scalability advantage of a compiled application. It's also important to note that while ASP.NET supports the previously mentioned "compile on demand" functionality, it's also possible to precompile ASP.NET applications into a .NET DLL, which is the method that Visual Studio .NET uses by default when building Web applications with it.

Based on the .NET Framework

As its name implies, ASP.NET is an integral part of .NET and the .NET Framework. All the core pieces of ASP.NET are implemented as .NET Framework classes. More important, ASP.NET applications have access to the common .NET programming model and the .NET Framework base classes, which include ADO.NET database access, XML parsing, and file IO. This helps make programming ASP.NET applications remarkably similar to programming Win Forms applications or Windows executable applications in .NET. Another advantage of the .NET platform is that it's completely language independent. I discuss .NET and the .NET Framework shortly.

Server Controls

Microsoft has introduced the concept of server controls in ASP.NET to help simplify Web application development, specifically for Visual Basic programmers who are used to programmatically accessing controls such as labels and text boxes. However, this change also greatly affects traditional ASP programmers, who will have to become accustomed to this new paradigm in Web application programming. Simply put, server controls allow programmatic access to HTML elements. This is heavily tied to the next change in ASP.NET.

One of the major elements of plumbing that an ASP programmer must perform is maintaining state. Windows application programmers take state maintenance for granted, as it happens automatically. Basically, state maintenance is keeping the values of fields, such as text boxes, when the page is refreshed. Server controls maintain their own state, so this is another plumbing task that the programmer no longer has to perform.

Server controls are designed to be intelligent and take advantage of specific browser capabilities. Web browsers all have different features and capabilities, and server controls will generate code according to what the browser requesting the page can display.

It's also possible to create your own server controls, which is a great way to encapsulate your code and increase productivity through code reuse.

Event-Driven Programming

Tightly coupled with the server controls paradigm is event-driven programming for ASP.NET pages. The introduction of the event-driven programming model in the Windows programming world revolutionized the way applications were programmed. The introduction of this model into the Web programming world should have an equally great effect on productivity and the simplicity of application development.

Server controls expose events, such as Click, for which event handlers can be programmed. This shields the programmer from having to handle HTTP responses and requests, although it's still possible to handle them manually using the respective traditional ASP intrinsic objects.

No comments:

Post a Comment

Related Posts Plugin for WordPress, Blogger...