What is ASP.NET?
What is ASP.NET?
http://samples.gotdotnet.com/quickstart/aspplus/doc/whatisaspx.aspx
ASP.NET (formerly referred to as ASP+) is more than the next version of Active Server Pages (ASP); it is a unified Web development platform that provides the services necessary for developers to build enterprise-class Web applications. While ASP.NET is largely syntax-compatible with ASP, it also provides a new programming model and infrastructure that enables a powerful new class of applications. You can modify your existing ASP applications by incrementally adding ASP.NET functionality to them.
Both ASP and ASP.NET applications can run side by side on a server without adversely affecting each other. This is primarily due to the fact that separate file extensions (.asp versus .aspx) and separate configuration models (metabase/registry versus XML-based configuration files) are used between the two technologies. The two systems have totally separate processing engines.
ASP.NET applications will run on the latest versions of Internet Explorer and Netscape Navigator. This ability is due to ASP.NET's use of DHTML.
To run ASP.NET applications on your Web server you need a computer configured with the Microsoft .NET Framework.
A user accessing an ASP.NET application doesn't need the .NET Framework. The user only needs a browser. As far as the user is concerned the site is just another HTML/JavaScript site.
Other Server-side Technologies
CGI
Common Gateway Interface applications are usually written in Perl or C. Since these are executeables on the server machine they have access to the operating system, and resources on the computer itself. And they are fast!
The problem is that CGI applications are difficult to debug. And if you have multiple users accessing a CGI application then server performance degrades because each application must run as a new process.
See the NCSA or James Marshall website for more details.
ISAPI Applications
Internet Server API applications are DLLs implemented in C or Delphi (a Pascal-like language). Since they are DLLs, they do not require a separate process which makes it perform better against multiple users.
The problem is that since it is a DLL, if that DLL misbehaves it has the potential to bring down the entire server because the DLL works inside the server's main process.
See the WRConsulting website for more details.
ASP Applications
Active Server Pages provides the ability to combine HTML, scripting, and server components that run on the server. These are created using VBScript or JScript. These applications can access databases.
The problem is that ASP applications are scripted not compiled which can make it hard to debug. Also because it is scripted performance is not optimal. And you are limited to VBScript and JScript.
See the Coastline.com website for more details.
Demo
Let's create a login page that verifies the user name and user password.
-
Start | Programs | Microsoft Visual Studio .NET 2003 | Microsoft Visual Studio .NET 2003
-
From the main menu select File | New | Project
-
Select Visual C# Projects and ASP.NET Web Application.
-
Press OK.
-
From the main menu select View | Toolbox, which will show you the available controls that you can use on a web form.
-
Drag on a couple of Label controls for User Name and User Password.
-
Drag on a couple of Text controls for the web user to enter a user name and password.
-
Drag on a Button control to validate the user name and password.
-
Double-click on the login button to add server-side code:
private void Button1_Click(object sender, System.EventArgs e) { if (TextBox1.Text == "dan" && TextBox2.Text == "pass") { Response.Redirect("http://www.msn.com"); } else { Response.Write("Unable to login"); } }
-
Press F5 to run the application.
-
Enter dan and pass. Note that the web application redirects you to http://www.msn.com.
-
Enter an invalid name. Note that the web application shows the "Unable to login" message.
We can quickly add functionality to make sure that user had entered text into the user name and user password textbox control by using .NET's built-in validators without writing a single-line of code.
-
Drag a RequiredFieldValidator next to the user name text box control.
-
Modify the ErrorMessage property to "Please enter a user name".
-
Set ControlToValidate to TextBox1.
-
Do the same for the user password text box control
-
Press F5.
-
With the text box controls empty, press the login button. Note that you get two red warning messages.
-
With only one text box control empty, press the login button. Note that you get only one red warning message.
Most demos show you how to do the easy programming stuff and imply that it's really easy. And of course, you find out that it's really much much harder in real life.
Fortunately, this is not the case. ASP.NET is one of the easiest technologies for creating websites. In fact, msn.com is an ASP.NET web site and obviously so is our website.