Visual Basic Concepts

Manually Adding Event Notation to an .HTM File

When Visual Basic saves the .htm file for a webclass template, it makes changes to it. For each tag attribute you connect to an event or a webitem, Visual Basic replaces a portion of the element's HTML with notation unique to the webclass. This allows the webclass to access the HTML page and determine the webitem and event that should be fired when the user selects the element. You can modify the .htm file manually to include this notation if you want to connect events without using the designer.

Note   You do not have to perform the process described in the sections below if you are connecting events from within the Webclass Designer; the designer automatically modifies the HTML file.

Manual Notation to Connect an Attribute to an Event

If you want to manually modify an .htm file to include a reference to a webitem and event, you use different notation than what Visual Basic includes automatically. For example, suppose you have an HTML template file that contains the following code:

<form method=post>

If you want to manually hook up this tag to an event, you could modify the HTML as follows:

<form action=www.mycompany-inc-10.com/Project1_MyWebclass.asp?
    WCI=webitem1?WCE=eventname method=post>

This notation indicates that the form tag should activate the webitem called "webitem1" and launch its FormSubmit event. The notation contains the following parts:

  • www.mycompany-inc-10.com is the server on which your webclass resides.

  • Project1_MyWebclass.asp is the name of the Active Server Pages (ASP) file associated with your webclass. The ASP is created when you run the project, and the name is set equal to the value of the NameinURL property for the webclass.

  • WCI=webitem1 identifies the webitem being referenced.

  • WCE=eventname tells the webclass the event in the webclass to which this tag corresponds. When the user selects the element for this tag in the browser, the webclass can read this notation and determine the event that it should fire.

Manual Notation to Connect an Attribute to a WebItem

When you connect an attribute to a webitem instead of an event, you do not use the WCE=Eventname syntax in your .htm file. Instead, you would use the WCI=Webitemname argument only, as shown in the following code:

<form action=www.mycompany-inc-10.com/Project1_MyWebclass.asp? _
   WCI=webitem1 method=post>

This notation indicates that the form tag should activate the webitem called "webitem1" and launch its default event. The notation contains the following parts:

  • www.mycompany-inc-10.com is the server on which your webclass resides.

  • Project1_MyWebclass.asp is the name of the Active Server Pages (ASP) file associated with your webclass. The ASP is created when you run the project and has the same name as your webclass.

  • WCI=webitem1 identifies the webitem being referenced.

For More Information   See "Connecting Events in a Webclass" for more information on connecting attributes to events and webitems.