The code on the left is a simple html page and the code on the right gets the current time and displays it using JavaScript
So What is a Web Server?
A web server is a piece of software that manages web pages and makes them available to the client browser via a local network or over the Internet. In the case of the Internet, the web server and client browser are typically on separate machines possibly thousands of miles apart. However for development of server side pages it is desireable to setup a local machine that has web server software running on it and then use the web browser on the same machine to see the pages as we develop them.
There are many web servers available, the common ones being Apache, and IIS. Since we are going to be using a Microsoft product then it is going to be necessary to run IIS (Internet Information Services) running on a Windows machine.
Fortunately for us Visual Studio handles emulates the web server for us so we don't have to do anything but install it on our machine. Earlier versions of Visual Studio forced us to install IIS but that is not the case anymore.
What is ASP.NET?
ASP.NET is a "new powerful server-side technology created by Microsoft for creating dynamic weg pages" and for the most part you can think of ASP.NET pages to be just like normal HTML pages that have certain sections marked up for special consideration. When .NET is installed, the local IIS web server is automatically configured to look out for files with the extension .aspx and to use the ASP.NET module which is actually a file called aspnet_isapi.dll to handle them.
The module aspnet_isapi.dll parses the contents of the .aspx file - it breaks them down into separate commands in order to establish the overall structure of the code. Having done this, it arranges the commands within a pre-defined class definition - not necessarily together, and not necessarily in the order in which they were written. That class is then used to define a special ASP.NET page object. One of the tasks this object then performs is to generate a stream of HTML that can be sent back to IIS, and from there, back to the client. Simply put, the ASP.NET module (aspnet_isapi) interprets the code and translates in into a stream of HTML that your browser can then display.
We should probably have a discussion on how .NET works but I will save this conversation for another .NET class. The one thing that you should know is that .NET uses a common language runtime. Which basically allows you to use any language that supports .NET. Basically, all languages that support .NET spit the code out into something called the MSIL (Microsoft Intermediate Language) which can be interpreted by the Common Language Runtime. The beauty of this is that you can use a variety of different programming languages. In the beginning their were only two languages; C# and VB.net but as time has gone by a lot of other languages have joined the bandwagon. Languages like PERL and Python just to name two now have support for .NET. Do you think this is driving the LINUX purists crazy? In this class, we are going to concentrate on C# but if you are a VB programmer feel free to write your code with it. Basically, I don't care what language you use.
Let's look at a simple example which could be used to make sure that IIS is installed properly.