Introduction to ASP.NET
By Stephen Bucaro
Microsoft introduced ASP.NET back in 2000, and eight years later it hasn't really
taken off. There are many reasons why it hasn't taken off, but the main reasons are
that it's difficult to find a simple explanation of ASP.NET without the marketing hype.
ASP.NET's primary advantage is in the development of large Web service applications,
and most Web programmers are not developing large Web service applications. And, to be
honest, plain old classic ASP is a great Web application.
ASP.NET is based on the .NET framework, and the main advantage of the .NET framework
is that you can write your code in virtually any language, and then run it on virtually
any platform. But most Web programmers use their favorite or assigned language on their
favorite or assigned platform and don't need .NET's versatility. The main advantage
of ASP.NET is that your code can be compiled to improve performance. But, unless you
have a very large Web service application, interpreted script runs very fast on today's
powerful servers.
Another problem with ASP.NET is that it's locked into the Visual Studio development
environment. I have never liked WYSIWYG, IDE, or any other kind of automatic code
generators. The problem is that they crank out reams of code that few programmers
understand. There are a lot of "programmers" out there that are really just application
users and don't really understand what they're doing. I prefer to type my own code
directly into a text editor, at least to start out, and information about how to do
that with ASP.NET is very scarce.
I'll start my explanation of ASP.NET with a simple block diagram. You can find all
kinds of diagrams of .NET on the Web, with anywhere from three to hundreds of boxes,
but I believe the one shown below provides the best general understanding.
(1) [ Programming Language ]
(2) [ MSIL compiler ]
(3) [ ASP.NET Web Services and Forms ]
(4) [ .NET Base classes Library ]
(5) [ Common Language Runtime ]
(6) [ Server Operating System ]
The top box (1) is the language you use to write code. You can write your code
in several different languages, like VBScript, JScript, or C#. (2) The .NET Framework
compiles the source code into MSIL (Microsoft Intermediate Language). MSIL is referred
to as an intermediate language because no computer architecture actually processes it
natively. (3) The MSIL references classes in the Web services and Web Forms layer of
the .NET framework. (4) The Web services and Web Forms classes reference classes in the
.NET Base classes Library. (5) The Common Language Runtime (CLR) converts the MSIL from
the .NET class Libraries to native code for the target operating system.
This is the simple explanation of how the .NET framework allows you to write your code
in virtually any language, and then run it on virtually any platform.
ASP.NET webpages can have two parts, one part containing the html code and ASP.NET server
controls, the other part containing the programming code that processes the server controls.
The first part is referred to as the "visual part" or "user interface" and is contained
in a file with the extension ".aspx". The second part is referred to as the "code-behind".
The extension of code-behind file depends upon on the language you use, for example
if it's written in VBScript it will have the extension ".aspx.vb".
|