1. Home
  2. Computing & Technology
  3. Visual Basic
Using Web Forms
to Build Interactive Applications
The Flow of the Code
 Topics
  From The Lesson
Learn VB and ASP
A VB 6 Tutorial
from About Visual Basic

 
The New "Express" VB
from About Visual Basic

 
Microsoft Suggestions
Web Hosting Services

 
Information About Hosting
from About Online
Business/Hosting

 
Microsoft ASP.NET
Quickstart Tutorials

 
Microsoft ASP.NET 2.0 Information
 
The DataGrid Component
from About Visual Basic

 

If you have experience with VB 6 and "classic" ASP, be prepared for even more dramatic change. ASP.NET is completely different from ASP just like VB.NET is different from VB 6 and ADO.NET is different from ADO. (Just as a comment, the massive scope of all the changes that Microsoft introduced along with .NET really boggles the mind. I still wonder how they did it.) Study the diagram on page 547 of the book. Note how all the code is on the server (Web Forms and Code-behind files). Although a lot of programming in ASP is also on the server, the scripts that made it happen were embedded into the HTML on the client.

That has all gone away in ASP.NET. (Client side scripting is still possible and useful when you're using ASP.NET, but it doesn't drive the server side processing anymore. It's been demoted back to the jobs it did before active server systems were invented.)

Program Execution

The illustration shows the steps to actually run your VB.NET code (either in ASP.NET or a standalone program ... they're the same). It's important to understand that the steps to compile and execute your program all take place on the server. And since the code is only compiled once on the server, ASP.NET code is very fast in comparison to earlier technologies.

In fact, the quick and easy way to change from ASP to ASP.NET is to add runat="server" to your HTML controls. This converts them from standard controls to server controls. For example, if you wanted to convert this standard HTML text box to ASP.NET:

<input type="text" id="myTextBox"/>

You would simply code:

<input type="text" id="myTextBox" runat="server"/>

This makes it a fully functional server-side control that you can use in your code. You can now work with component events, set attributes, and bind the component to a data source.

The IL Code in the illustration is Intermediate Language. .NET creates the same IL Code no matter what programming language you use, so you get the same speed of execution and the same programming libraries whether you are programming in VB.NET, C#, or one of the many other languages that are now .NET compatible. The first time a program is executed on the server, the JIT (Just-In-Time) compiler saves the machine code version in a cache file so this compile step doesn't have to be repeated either.

Next page >>>   IIS and Hosting
Page 1, 2, 3, 4, 5
Explore Visual Basic
By Category
About.com Special Features

Holiday Central

What to eat, where to go, fun things to do and how to save money on the perfect gifts. More >

Family Tech Center

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

  1. Home
  2. Computing & Technology
  3. Visual Basic

©2009 About.com, a part of The New York Times Company.

All rights reserved.