It is quite normal that people has confusion between ASP.NET and PHP.
In fact, ASP.NET is a subset of .NET Framework and PHP is a server site
programming language. At the end, they may take part in developing web
application but there are not the same.
.NET
Framework is a big set of classes and libraries that have been created
for developing all sorts of application; such as Windows Standalone
Application, Dynamic Link Library or Web Application. And, ASP.NET is a
subset of this "big family". ASP.NET contains classes and libraries that
related to web development.
.NET Framework consists of
two parts; Framework Class Library and Common Language Runtime. In
fact, it is quite similar to JAVA. The concept behind .NET Framework is
to build a cross architecture application that will split the process
into compiling and running code in two different mode. Let take a look
at the JAVA work flow diagram.
A
JAVA source code with file extension of .java is compiled into a
bytecodes file with file extension of .class. And the .class object file
can be executed by JVM (Java Interpreter). It is a great concept from
JAVA creator to separate the code from the machine. Thus, the task of
communicating with different type of CPU architecture has been passed to
JVM and class file will be able to run on different type of platform
without modifying the source code and re-compilation depend on
architecture is not needed.
In
.NET, the similar concept is adapted in order to achieve this. Let take
a look at the diagram above. It is a typical process of a .NET
workflow. The source code will be compiled into MSIL (Microsoft
Intermediate Language). And upon execution, it will be compiled by JIT
compiler, resided in .NET engine, into a native code that can be
executed by that particular machine.
For ASP.NET, the
common programming language being used are C# and VB.NET. The source
code of these program will be compiled by different language compiler
(as C# source code can be only understood by C# compiler) stated in the
page directive of the top of the aspx file. This will generate a
Intermediate Language file. Then, it will be executed after compile by
JIT into a native code.
I hope it will be useful to
those person who just wanted to start to learn .NET or ASP.NET
development. In short, you may compare C# with ASP.NET vs PHP but not
ASP.NET vs PHP.