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.

See also  5 Ways to Improve Customer Experience
devxblackblue

About Our Editorial Process

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

About Our Journalist