devxlogo

Create Line Breaks in the VID Label Object

Create Line Breaks in the VID Label Object

The Visual InterDev label script object is a quick way to display text on your Web pages. Trouble is, the data from your recordset may contain line breaks that the label object ignores. The trick to passing line breaks to your label is to use the VBScript Replace() function. It converts the original carriage returns into HTML
tags. In addition, you need to tell the label object to prepare for the
tags and interpret them correctly on the page. If you don’t include setDataFormatAs(“html”), the label displays the tags instead of line breaks. This code shows the line break technique in action.

 

One more tip: Rather than using the setDataFormatAs() method in your code, you can check the “Data Contains HTML” box in the Label design-time control.

devx-admin

Share the Post: