Beginning Active Server Pages

Introduction

Active Server Pages enables a web developer to replace static HTML pages with 'live data'. This information might be from a database, or simply by using cookie information. But why does this have any relevance to a VB website? The reason is Active Server Pages use Visual Basic as its main language (it also supports Javascript), and therefore makes it easy for a VB developer to become an ASP developer too. However, please note that this tutorial assumes some knowledge of HTML.

Changes in VB Web Tutorials

VB Web have introduced a few changes in its tutorials. The first are these boxes, which provide information related to the topic being discussed, but not essential to the tutorial! Next, is the highlighting of code. Any new code has a light grey background. Code that you have come across before, and hasn't changed has the standard white background.

First, lets take a look behind the idea of Active Server Pages. Normally, when someone visits a site, his browser sends a request for a certain file, such as index.htm. The server will then return this file to the client PC, and it will be displayed in the browser:

Active Server Pages, meanwhile, allow Visual Basic script to be processed on the server before sending the file back to the client.

This has a number of benefits

  • Unlike client-side code, such as the javascript that makes ad windows popup, the browser does not need to understand VB - it doesn't even get to see it.
  • The VB code can act on information passed to the page, such as from an internet form or a querystring (this is data passed in the URL after the ? ... take a look at this pages URL!). It can then use this information to display data, or retrieve specific information from a database
  • Only the smallest amount of data is sent to the client - only the HTML that the page outputs is sent, not the VB code. This also means that the authors VB programming work is protected from visitors!

You might also like...

Comments

About the author

James Crowley

James Crowley United Kingdom

James first started this website when learning Visual Basic back in 1999 whilst studying his GCSEs. The site grew steadily over the years while being run as a hobby - to a regular monthly audien...

Interested in writing for us? Find out more.

Contribute

Why not write for us? Or you could submit an event or a user group in your area. Alternatively just tell us what you think!

Our tools

We've got automatic conversion tools to convert C# to VB.NET, VB.NET to C#. Also you can compress javascript and compress css and generate sql connection strings.

“A computer lets you make more mistakes faster than any other invention in human history, with the possible exceptions of handguns and tequila” - Mitch Ratcliffe