p2p.wrox.com Forums

Need to download code?

View our list of code downloads.

  Return to Index  

proasp_howto thread: Constructor in VB

Message #1 by "Alex Shiell, ITS, EC, SE" <alex.shiell@s...> on Thu, 8 Feb 2001 14:58:31 -0000
In the past when I have needed to create a dynamic menu system, I have done
it in the client side by creating an array of "menu items" and then running
a function which builds the menu from it, and other functions to manipulate
the menu.

the "menu items" are objects with a number of properties, created in
javascript by a constructor, as shown below

<script language="javascript">
function MenuItem(strItem, strImg, bHasSubMenu, intSubMenuIndex, strLink){
	this.MenuItem = strItem;
	this.Img = strImg;
	this.HasSubMenu = bHasSubMenu;
	this.SubMenuIndex = intSubMenuIndex;
	this.Link = strLink;

ayMenuItems = new Array;
ayMenuItems[0] = new MainMenuItem("Home", "home.gif", 0, 0, "home.asp");
ayMenuItems[1] = new MainMenuItem("Search", "search.gif", 0, 0,

the advantage of this approach being that all the menu items are defined in
one place, so its quick and easy to make changes

I now need to be able to do this on the server side.  However, I'm not sure
how to write a simple constructor like this in VB, or indeed if it is

can anyone advise me how I could create a menu item object like this in VB?
The only thing I can think of is to have a function which returns a
collection object with these keys already added.

Scottish Enterprise Network

  Return to Index