Introduction to ASP.NET



Active Server Pages (ASP) is a technology developed primarily by Microsoft to create dynamic web sites that allow a visitor to submit values to a web page. The web page would then transmit the results to a web server. This technology requires some use and knowledge of a scripting language such as VBScript or JavaScript. It is also easily understandable to Visual Basic programmers because both use the same approach to solve problems. To enhance it, Microsoft developed ASP.NET. This new approach allows you to use the .NET Framework and its rich features to create web-based applications.

The .NET Framework is a library used to create both computer-based and web-based applications. It is made of different parts. The section that deals with computer applications is referred to as Windows Forms. The part dedicated to the web is called ASP.NET. Although these various sub-libraries make up the .NET Framework, you can create fully functional applications using only ASP.NET. One of the differences between ASP.NET and ASP is that ASP applications were mostly interpreted (except for some libraries (DLLs) that were working in the background at the server level during processing) by the browser while ASP.NET applications are compiled.


ASP.NET Prerequisites

To create ASP.NET applications, you must prepare your computer, the one you will be using to develop your applications. To start, your computer should run one of the following operating systems:

  • Microsoft Windows XP Professional (no Home Edition)
  • Microsoft Windows 2000 Server
  • Microsoft Windows Server 2003 (any version)

Also, you should (according to Microsoft, "must"; but you will see in our lessons that we will be using different browsers to test the pages) install the latest Internet Explorer browser. The minimum you should have is Internet Explorer 5.5 but, unless you have any particular reason, you should install the 6.0 version.

To support databases (even if you don't intend to create web-based databases), you must install MDAC 2.7 or later, which is a free download from the Microsoft web site. Normally, you may have MDAC installed already but just in case you need it...

Along with one of the above operating systems, you must install Microsoft Internet Information Services (IIS) 6.0 or later. Normally, during the installation of the operating system, you would have been prompted to install it. Otherwise, you can install it from Control Panel -> Add/Remove Programs -> Add/Remove Windows Components -> Internet Information Services (IIS) and follow the steps:

Once the operating system and these components are ready, you must install the .NET Framework. It is likely to be installed already. You should install he latest. If you want to check, you can open the Add/Remove Programs from Control Panel and you should see an entry for Microsoft .NET Framework:

You can also see its entry in the Start menu. If you don't have it already, you can download it (free) from the Microsoft web site at http://www.asp.net.

To follow the lessons on this site, you must be a little familiar with HTML. It is not realistic to teach HTML and web application development at the same time.

In our lessons, we will mostly assume that you don't know C#: we will study it from the beginning.

Preparing Web Tests

Starting in the next lesson and throughout this site, we will learn how to create web pages. After creating a web page, you should test it. You have two options. You can test a page locally by executing your project as we will learn in the next lesson. Alternative, you can test it on a real web site. You have various alternative. You can setup a web server at home or at your job to host your (own) web site. The process is, or can be, long and there are various issues involved (name registration, DNS, etc).

An alternative to hosting your web site is to let another company host it for you. We wrote a few topics on this issue. When selecting a company that would host your web site, make sure that (specify to your hosting company that) your site can display ASP.NET web pages. Also make sure they have tested it and it works fine.

To test a .NET web control and show the version of the .NET Framework, enter the following code in Notepad and save it as test3.aspx

<%@ Page Language="VB" %>

<script runat="server">
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
        lblVersion.Text = "Your server is running ASP.NET and the " & _
			  "version is " & System.Environment.Version.ToString()
    End Sub

    <title>ASP.NET Version</title>
    <form id="form1" runat="server">
        <asp:Label ID="lblVersion" runat="server"></asp:Label>

Place the page on your web folder and access it from a browser. Here is an example of what this would produce:



Home Copyright 2005-2007 FunctionX, Inc. Next