Overview
ASP.NET is an exceptionally remarkable technology for building web applications.
We begin exploring ASP.NET pages with this first article. In this article we'll learn :
- From where to download ASP.NET premium edition?
- The installation process.
- Developing your first ASP.NET page.
- Running and testing your ASP.NET page.
Where to get ASP.NET premium edition?
To run ASP.NET pages you need to download and install Microsoft
ASP.NET Premium Edition. ASP.NET premium edition contains CLR ( Common Language
Runtime ), .NET Framework Libraries, ADO.NET and compilers for C#, VB.NET and
JScript.NET languages.
To download ASP.NET premium edition, go to ASP.NET home page and follow the link which says "click here to
download ASP.NET Beta 2". The download is approximately 18 MB in size and should not
take long on any connection.
The installation process
The installation for ASP.NET premium edition is pretty simple ( since there is no
documentation and samples ). Make sure you close all open windows and applications
before starting ASP.NET setup program.
The setup for Beta 2 works much better than that of Beta 1 and you should be able to
install it easily on your system. Once you have successfully installed it then move
forward.
Developing your first ASP.NET page
Although VisualStudio.NET Beta 2 is available with intellisense technology to help
you develop ASP.NET applications quickly, there is no reason why you cannot develop
ASP.NET pages using simple Notepad ( this is what I do! ).
The root directory for ASP.NET pages is the same as that of simple ASP pages running
under IIS. For example's sake, we'll assume that your root directory for ASP pages
is C:\inetpub\wwwroot. Make a new directory with name of "NET" under this root
directory. This new directory is *not* needed but it is still better to keep ASP.NET
pages separate from ASP pages.
In that C:\inetpub\wwwroot\NET folder create a new ASP.NET page with name of
firstPage.aspx ( notice the .aspx extension ). To be able to run both ASP and ASP.NET
pages side by side, ASP.NET pages have a separate extension; .aspx. Also keep in mind
that we are using C:\inetpub\wwwroot for example's sake, you can easily substitute it
with your real root directory.
firstPage.aspx ASP.NET page
Copy and paste the following C# ( ASP.NET ) code in the firstPage.aspx page and
hit the save button :
<%@ Page Language="C#" %>
<html>
<head>
<style>
p { font-family:Tahoma, Sans-Serif; font-size:10pt; }
</style>
</head>
<body>
<p align="center">
Congratulations! this is your first ASP.NET page.
</p>
<p align="center" style="background-color:#F7F7F7;margin:0,100,0,100;">
<%= System.DateTime.Now.ToLongDateString() %>
</p>
</body>
</html>
Explanation
Most of the code above is simple client-side HTML. I'll explain the few lines of
ASP.NET code in it. Notice the first line? this line is a Page directive
which tells the ASP.NET translator that this page will be using C# language so use
the C# compiler to compile this page.
<%@ Page Language="C#" %>
You can use any of the three languages ( C#, VB.NET & JScript.NET ) provided with
the ASP.NET premium edition to develop ASP.NET pages. Since C# is pretty close in syntax
to Java, I'll be using C# in all the code samples on Stardeveloper from now onwards.
Next we write the current date to the user screen using System.DateTime class's
static property Now's ToLongDateString() method.
<%= System.DateTime.Now.ToLongDateString() %>
Like classic ASP pages, <%= is equivalent to Response.Write() in ASP.NET pages.
So anything between the <%= and %> tags will be written on the user screen.
Running and testing your ASP.NET page :
To run firstPage.aspx page, open your browser and enter something like
http://localhost/net/firstPage.aspx in the URL box and hit enter. If all goes well, you
should see something like following on your screen :

firstPage.aspx