Testing a DTC's Output

Testing is easily accomplished by adding your control to a Web file (.asp or .htm) in a Visual InterDev project. The editor allows you to view both the control's user interface and the code it generates. If you want to verify the choices that a DTC publishes, you can use the Choice Inspector.

Before testing your DTC code, you need to build and register the control as a DTC. Typically your development tool performs both when you make the control. However, a Visual Basic control requires additional steps. See Registering a Visual Basic Control as a DTC.

To test your DTC

  1. In Visual InterDev, right-click the toolbox and choose Customize Toolbox.

  2. From the Design-Time Controls tab, select your DTC.

    Note   If you didn't change the name of the control, you may find it has the default control name used when you created your DTC project. Also, if the control was not registered as a design-time control, it may not appear in the list. You can make sure it appears by registering the control.

  3. Open an HTML or ASP page and switch to the Source tab in the Editor.

  4. From the Toolbox, drag your DTC to the page and test the interface.

    Note   Although you can print a page with a DTC in it, the values based on published choices are not reflected in the printed copy.

  5. Right-click your DTC and choose Show Run-Time Text to verify its run-time output.

  6. View the Web page in a Web browser.

After testing your DTC, close the Web project and then make changes to the DTC in the original development tool. You need to close and reopen the Visual InterDev Web project before adding the control to the page. Then, to test the modified control, open the Web project and perform the procedure above, beginning with step 4.

For more information about designing or debugging your control, see Design Guidelines and Troubleshooting.