Previous
Left Arrow
Flickity carousel with 2 rows and 4 columns designed with ASP Classic and SQL Server
Current Code Entry
Go Back To Code List
[Forms]
  • ASP Classic using VBScript to Create a Variable that holds an HTML layout in code with element on its on line

    Article Entry Date: February 16,2026 @ 06:58:08 / Last Updated On: February 16,2026 @ 07:00:18
Creating a Variable to be reused multiple times on a page is easy to do with VBScript in Classic ASP.

When I first began learning ASP Classic around 1999-2000, I learned how to do this, but as I got better at design, I no longer used this method unless I needed to write out code multiple times, as you see on all the sites I design.

What we are going to create is the table layout for our new SynEdit that will be launched soon.
With the Sample ASP Variable held within the layout.




What is happening in this code?
The " & _ allows you to have multiple lines in your code.
The vbCrLf creates a new line in the HTML code when rendered.
The " & vbCrLf & _ entire line allows for multiple lines to be added in your code, and then creates the new line in your HTML when rendered.

Place this code in a new page and save it, and then run it.