Make ASP-Generated Code Easier to Read With VbCrLf

Make ASP-Generated Code Easier to Read With VbCrLf

Technically, neatness doesn’t count in the world of HTML source code. However, nicely formatted source code makes debugging easier and adds a professional touch to your work. That’s why HTML text editors usually generate very readable source code that includes line breaks and indentations.

You may have noticed that HTML code that is created on the fly using Active Server Pages (ASP) can look quite ragged. It can even come out as one long line of HTML when viewed in Notepad. To increase the readability of the source code, add line breaks to your server-side VBScript with the built-in string constant vbCrLf. In your ASP code, vbCrLf writes a carriage return and new line combination.

For example, the addition of vbCrLf in this code makes no difference to the HTML page as seen in the Web browser, but the line breaks make a world of difference to anyone who wants to read the HTML source that the ASP script created.

 <%@ Language=VBScript %><%For Each name In Request.ServerVariables   Response.Write name & "="  & _    Request.ServerVariables(name) & "
" & vbCrLfNext%>

VBScript also provides the constant vbTab to insert a tab character. HTML browsers ignore vbTab just like they ignore vbCrLf.

Share the Post:
Heading photo, Metadata.

What is Metadata?

What is metadata? Well, It’s an odd concept to wrap your head around. Metadata is essentially the secondary layer of data that tracks details about the “regular” data. The regular

XDR solutions

The Benefits of Using XDR Solutions

Cybercriminals constantly adapt their strategies, developing newer, more powerful, and intelligent ways to attack your network. Since security professionals must innovate as well, more conventional endpoint detection solutions have evolved

AI is revolutionizing fraud detection

How AI is Revolutionizing Fraud Detection

Artificial intelligence – commonly known as AI – means a form of technology with multiple uses. As a result, it has become extremely valuable to a number of businesses across

AI innovation

Companies Leading AI Innovation in 2023

Artificial intelligence (AI) has been transforming industries and revolutionizing business operations. AI’s potential to enhance efficiency and productivity has become crucial to many businesses. As we move into 2023, several