Visual Basic Concepts

Step Two: Add the Menu Template

The first page in the application is the Menu page, which contains buttons you use to access the data pages. You must create this page and add it to your webclass. For the sake of this tutorial, you can cut and paste the code shown in the procedure below to create the necessary file.

  1. Open Notepad, then copy the following HTML code and paste it into a blank document:
    <html>
    <head><title>Customer Support</title></head>
    <body>
    <h1>Call Tracking</h1><br><hr>
    <p>Select from the following reporting options to view data:</p>
    <form method="POST" id="ShowAllCustomers"><input type="submit" value="Show All Customers" name="btnCust"></form>
    <form method="POST" id="ShowAllCalls"><input type="submit" value="Show All Calls" name="btnCalls"></form>
    </body></html>
    
  2. Save this page in the directory to which you saved your project, and name it menu.htm. Close Notepad.

  3. In Visual Basic, open the Support project and display the designer. Click the Add HTML Template WebItem toolbar icon.

  4. In the Add HTML Template dialog box, click menu.htm, then click Open. Visual Basic loads the page and displays it with the default name Template1. The HTML tag attributes in the template are displayed in the detail panel of the designer.

  5. Rename Template1 to Menu.

  6. Save your project. The following picture shows what you should see:

    Note   If you look in your project directory, you will notice that there is now a file called Menu1.htm. The webclass designer makes a copy of any template webitem you add and uses the copy instead of the original. That way, any changes made to the file do not affect your original.