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

ASP.NET - Learn Programming for the Networked World - Part 1

By , About.com Guide

5 of 6

Code-behind - - better than inline code

Code Behind Example

Code Behind Example

It's important to understand exactly what's happening when you execute a "round trip" using ASP.NET - including what a round trip is. Let's look at a round trip using the "code behind" sample above.

An ASP.NET round trip starts when you enter a URI (web address) into the "Address" box of your browser. The magic of the Internet sends this request to a server somewhere. (This "magic" is usually displayed as a fluffy white cloud in diagrams but I've left that out because I think we understand things like that now.) In our case, the file requested is aspexample.aspx.

If the web server is configured to host ASP.NET, then the file type ".aspx" alerts the server that this is an ASP.NET page. The server retrieves the file (remember ... the file is on the server, not on the client) and an ISAPI "filter" (Internet Server Application Programmer Interface), part of ASP.NET, interprets the ASP.NET directive statement in the file to discover that there should also be a VB.NET program called "aspexample.aspx.vb" (in Visual Studio .NET) on the server. If the .aspx page has not been requested before, the program is compiled into an executable and saved so the compile doesn't have to be done again. This is one of the major sources of efficiency for ASP.NET. There is even a way to pre-compile the .aspx pages using a new XML file configuration file in ASP.NET.

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
  4. Learn VB.NET
  5. Learn ASP.NET
  6. ASP.NET - Learn Programming for the Networked World - Part 1

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

All rights reserved.