Creating your own class definition with the traditional ASP
Posted by Daniel - 1,276 Views
To follow the steps on this article you need at least Microsoft Windows 9x and IIS installed. This time we will learn and take a closer look at one of the traditional ASP?s feature, it is the ability to accept coder?s class definition. Long before the release of the .NET framework, this feature remains hidden for most of the coders, including myself. If you already familiar with Visual basic, you won?t find any difficulties implementing this feature into your web application since the structure needed to assemble an ASP class is quite similar to the class structure within the Visual Basic.
OK, lets get into it. Below is a simple class definition example created with traditional ASP, named MotorBike.
Private x_MBikeMake
Public Property Get Make()
Make = x_MBikeMake
End Property
Public Property Let Make(z_Make)
x_MBikeMake = z_Make
End Property
Private x_MBikeModel
Public Property Get Model()
Model = x_MBikeModel
End Property
Public Property Let Model(z_Model)
x_MBikeModel = z_Model
End Property
Public Sub Combine()
response.write Make & ” : “ & Model
End Sub
End Class
On the example above, MotorBike Class consists of two private members (the Bike manufacturer and the bike model), four public properties (2 get, 2 set), and a Sub Procedure (combining the bike manufacturer and the bike model).
To use it on your ASP page, add the code below under the class definition, then save it as motor.asp,
Set objMotorBike = New MotorBike
objMotorBike.Make = “KAWASAKI”
objMotorBike.Model = “Ninja ZX-10R”
objMotorBike.Combine()
If you run the page on your browser, the result is the combination of the bike manufacturer property value and the bike name property value outputted by the Combine Sub of the class. I use this feature to create the SimpleGridBuilder, a very simple database driven grid builder.
The following posts are programmatically considered as related to the current post by YARPP Plugin:
- SimpleGridBuilder (ASP class definition)
- Runtime-Form-Creation. Automatically creating child forms in a Delphi MDI application with a component array
- Resizing image on the fly with ASP.NET using the System.Drawing namespace
- Replacing and filtering text with regular expression using Delphi, Visual Basic and ASP
Hi, my name is Daniel Nugraha, a single male live on an island called Java, Indonesia. This is the place for me to share my interest in computer programming.
-
Get my Full Feed Here
Popular Entries
- Passing arguments to your VB.NET console application
- Microsoft Excel Import External Data Problem: When Microsoft Query doesn’t recognize some of your parameters
- Resize Image or Crop Image with Joe Lencioni’s Smart Image Resizer, WordPress Setup
- How to Get User Input and allowing more than 256 characters to be entered on .NET Console Application
- ASCII To PDU Converter (Convert ASCII to PDU and vice versa)
- ConsoleProgressBar - Simple Progress Bar Function for your VB.Net Console Application
- An example: Using CPort Delphi Component to read data from your cellphone
- Runtime-Form-Creation. Automatically creating child forms in a Delphi MDI application with a component array
- CPort Component (Serial port interface component for Delphi)
- SmartImageResizer Plugin, WordPress plugin based on Joe Lencioni’s Smart Image Resizer













