You are here:   Home
  |  Login
What is ASP?



If you have done any serious web programming then you have probably heard of ASP. ASP is a scripting language developed by Microsoft that runs on a web server. Some of you may ask why we don't just write everything in HTML and leave it at that. Pages written in HTML are said to be static. This means that the contents of the page has been determined before it gets displayed. The web has grown exponentially in the past several years and we are always trying to do more than it was originally designed for. The HTML language is great for rendering static content and to a certain degree the original idea of the World Wide Web was just to display information. Now we want to be able to do shopping, stream video, and even make long distance telephone calls over the Internet.

Static web pages are rendered as follows:

  1. A web author writes a page composed of pure html and saves it with an extension .htm or .html on the server
  2. Sometimes later, a user types a page request into their browswer, and the request is passed from the browser to the web server
  3. The web server locates the .htm or .html page and converts it into an HTML stream.
  4. The web server sends the HTML stream back across the network to the browser.
  5. The browser processes the HTML and displays the page
Let's take a look at both static and a dynamically created pages:

Click on the code see the programs run

Static and Dynamic Web Pages

   Minimize
Static Web Page
Using JavaScript to show current time

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.
Tools for Writing ASP.NET Code


The best bet is to use a version of Visual Studio. At the time of this writing Visual Studio 2010 was about to be released and may be your best bet. I have not downloaded a beta version of 2010 so I am using VS 2008 for the course work. We can discuss the use of 2010 maybe some of you would like to provide some details as to the differences.

DreamSpark - You can download quite a bit of software from the Dreamspark web site. It is setup by Microsoft to give students access to free software. Dreamspark requires you to register or login with a LiveID. The nice thing about this is that your Blacboard login is a LiveID so you can simply go to the dreamspark website and login with your Blackboard login.

Academic Alliance - This is an agreement the school has with Microsoft to allow us to give you free software. To use this site you will need a login which I will setup the first week of school.

Visual Studio Web Developer - This is a free version that only contains project types for asp.net. While Visual Studio is nice to have, you may find it to be overkill for what we are doing in this class.

Using Visual Studio

   Minimize