Search Search

#1 worldwide
FREE Coding Lessons

since 1996
   THE BEST WAY to learn ASP & Asp.net!
Advertise Here!
click for details
Credits Host:
DiscountASP.net
Server Admin:
The "Team"
Contact Info.
Charles M. Carroll

my Blog

Generic VB Component Building Steps

Making a VB ASP component is easy:

  • Use File; New Project

  • choose Active-X DLL

  • You will now be in the editor and there will be a class open

  • when you are done, the code to invoke it on a page will look like:
    set .... = server.createobject("projectname.classname")
    choose your project plus class names well.

  • The project name and class name are set with the (name) property. They are NOT in anyway connected to the filename although you may make the filenames match the project and class names.

  • If you need to use one of the five built-in ASP objects (collectively called the scripting context) you can add a special event to your class called OnStartPage. Anytime your component is created from an ASP script, ASP will call your OnStartPage if it exists within your class. OnStartPage allows you to assign the built-in ASP objects (response, request, server, application, session) to objects in your code:

Public Function onstartpage(sc As Object)
   'Set ... = sc.response()

   'set ... = sc.server()
   'set ... = sc.Request()
   'set ... = sc.application()
   'set ... = sc.session()
End Function

  • If needed, you can add this event:

Public Function onendpage(sc As Object)
End Function

Chaz Wish List
Tall Tip $5
Grande Tip $20
Venti Tip $39
Tip Jar Thanks
2004 Thanks
2005 Thanks
HUGE Tip -love site