Rendering HTML for controls in an HTML Web DataWindow

This section applies to the HTML Web DataWindow only. You can use XHTML templates to customize the display of the XML Web DataWindow and XHTML Web DataWindow. For more information, see Chapter 11, “Working with XHTML Templates.”

NoteNo validation The HTML Generator does not validate the HTML you include in controls in DataWindow objects. If the HTML is not valid, the DataWindow might not display correctly.

Including HTML in a control

You can include valid HTML in some controls in a DataWindow object, including a text control, column, or computed field. To render the contents of the control as HTML when the HTML for the DataWindow is generated, set the control’s ValueIsHTML property to true. For example, suppose a text control’s text property is <I>Name</I>. The following table shows how the text is rendered in the generated HTML and displayed in a browser.

Table 10-7: Effect of ValueIsHTML property on rendered text

ValueIsHTML

Generated HTML source

Output in browser

TRUE

<I>Name</I>

Name

FALSE

&lt;I&gt;Name&lt;/I&gt;

<I>Name</I>

When you embed HTML in a control, you can cause ASP to detect a security risk. To avoid this, add validateRequest='false' in the page directive of your ASP page.

Appending HTML to a control

The AppendedHTML property enables you to append your own HTML to the HTML generated by the HTML Generator component. You can use this feature to specify attributes and event actions. The HTML you specify for the AppendedHTML property value is appended to generated syntax for the rendering of a DataWindow control before the closing bracket of the HTML element for that control.

You must also make sure not to use an event handler name that is already generated for a DataWindow control as a client-side event handler. These include the names listed in Table 10-8.

Table 10-8: Generated event handler names

DataWindow control

Generated event handler names

Edit, EditMask, DropDownListBox, or DropDownDataWindow

onFocus, onClick, onChange, and onBlur

CheckBox or RadioButton

onFocus, onClick, and onBlur

TextBox, Picture with link, or Button

onClick