Understanding DTC Output

Your DTC's output depends on the text that you want the DTC to generate. The structure and content of the generated text is entirely up to you and how you design the control. The control can generate any text that can be inserted into a file by a knowledgeable user with a standard text editor.

Using a text sample that accomplishes your purpose, you can determine the information to be supplied by user response, calculations, literal strings, and so forth. For example, you can create a DTC that allows a user to choose a type of fruit and to display that selection in a statement on a Web page such as <B>The selected type is Cherry</B>. You determine the user interface of the control based on the text you want generated. This example needs one text box to specify the fruit. Literal strings create the rest of the HTML syntax.

When the file is saved, the text generated by the design-time control is placed between the metadata needed by the editor to reopen the design-time control and make changes. The text is within the metadata span. Since this span is inside an HTML comment it's invisible to most Web browsers. If a file is an Active Server Page, the design-time control is stripped from the file before the file is processed and only HTML is delivered to the browser.

After you add a design-time control to a page, you can view it graphically or as text.

Here is the text view of a design-time control.

<!--METADATA TYPE="DesignerControl" startspan
<OBJECT ID="SourceDTC" CLASSID="CLSID:CF40D084-10E4-11D0-8712-00A024A7C573">
<PARAM NAME="ExtentX" VALUE="5556">
<PARAM NAME="ExtentY" VALUE="1138">
<PARAM NAME="Fruit" VALUE="Cherry">
</OBJECT>
-->
<B>The selected fruit is Cherry.</B>
<!--METADATA TYPE="DesignerControl" endspan-->

This sample also shares the fruit value with other DTCs on the page. You can see the parameter called fruit with the value cherry. The DTC published a Choice object of type "Fruit" and the current published value is "Cherry." All DTCs that subscribe to that type of choice are notified that Cherry is the value.

For more information about how DTCs share information, see Sharing Information Between DTCs.