Using Design-time Controls in Visual InterDev

Implementing a Design-time Control in an ASP

In this exercise, you will use the Data Connection design-time control in an Active Server Page.

* To implement a design-time control

  1. Start a new Web Project in Visual InterDev and name it Employees .
  2. Save it in WA\Practice\Ch10\employees .
  3. Leave the servername localhost and click Next .
  4. Leave the default name, Employees and click Finish .
  5. A valid data source name needs to be first associated with this project. Right-click the project in the FileView window and click Add Data Connection .
  6. Click the Machine Data Source tab, select nwind , and then click OK .
  7. Review the default connection information. The name of this data connection will be DataConn .
  8. Close the Data Connection Properties window.
  9. Add a new ASP page named default.asp .
  10. Delete the HTML comment.
  11. Right-click between the BODY tags and click Insert HTML Using Wizard .
  12. Select the Data Range Wizard and click OK .
  13. Select Show only and specify two records at a time and click Next .
  14. Leave the default data range name and click Finish .
  15. The Properties dialog will appear. In the Data Connection box, select DataConn .
  16. In the Command Text box, type Select * From Employees .
  17. Click Copy Fields .
  18. Add the EmployeeID , FirstName , and LastName fields to the Fields to Copy list and click OK .

    The VBScript to display these fields has been copied to the clipboard. You can then paste the script into the appropriate location on the Web page.

  19. Close the Properties box.
  20. Close the Design-Time control window.
  21. Place the insertion point before the second instance of this line of code:
     <!--METADATA TYPE="DesignerControl" startspan 
  22. Right-click the page and click Paste .
* To test the application
  1. From the FileView window, right-click default.asp and click Preview in Browser .
  2. Click Yes if prompted to save your changes.
  3. Test the navigation buttons on the page.
  4. Exit Microsoft Visual InterDev.

Lesson Summary

ActiveX design-time controls are tools that write server-side script, client script, or HTML using applications such as Microsoft Visual Basic or JavaScript. You can use existing ActiveX controls, or you can author your own design-time controls using Visual Basic. Microsoft Visual InterDev provides design-time controls that add functionality to your programs.



Microsoft Windows Architecture Training
Microsoft Windows Architecture for Developers Training Kit
ISBN: B00007FY9D
EAN: N/A
Year: 1998
Pages: 324

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net