Many friends don't know much about the implementation of ASP line breaks, and they don't know what code to use under what circumstances. Here Wulin.com will briefly explain it to you, hoping it can be helpful to everyone.
Test code: output simple ul li
1.asp
Copy the code as follows:<%
response.write <ul>
response.write <li>Wulin.com</li>
response.write <li>www.vevb.com</li>
response.write </ul>
%>
Result Yes: Right-click the source file and you will see
the copied code as follows:
<ul><li>Wulin.com</li><li>www.vevb.com</li></ul>
1. If you want the characters to be output well in the source file, to facilitate reading optimization, etc., you can use the vbcrlf
code to write
the copy code as follows:
<%
response.write <ul>&vbcrlf
response.write <li>Wulin.com</li> &vbcrlf
response.write <li>www.vevb.com</li>&vbcrlf
response.write </ul>
%>
The output source code is
the copied code as follows:
<ul>
<li>Wulin.com</li>
<li>www.vevb.com</li>
</ul>
Second: If it is an ordinary file, you can use
the copied code in the middle as follows:
response.write <div>武林网<br>www.vevb.com </div>
The third type: If it is to be displayed alternately in textarea and html, then
in this case the content is generally submitted through textarea instead of web page editing, then the line break of textarea needs to be replaced with <br>
CHR(10) means line feed, CHR(13) means carriage return.
The line feed character in asp can be used with constant: vbcrlf and function: chr(13);
copy the code as follows:
response.write Login successful&vbcrlf&Welcome to use
content= replace(content,vbcrlf,<br>) -The
following is to replace the newline in the textarea with <br>.
Copy the code as follows:
fString = Replace(fString, CHR(10), <br>)
fString = Replace(fString, CHR(13), <br>)
If it is the other way around, the br line breaks in html need to be replaced with the line breaks in textarea.
Copy the code as follows:
fString = Replace( fString, <br>, vbcrlf)
will not be written more specifically. You can test it by yourself. The program is tested while writing. It's not obvious.
Other explanations:
When I was writing an ASP program recently, I wanted my HTML code to be output directly in ASP, and I also asked him to output it in a very neat format. I tried the long-used tab symbols /n and /t that I have written about for a long time, but they could not be output directly. So Diplodocus checked the relevant information on Baidu and posted it to let people pay attention to Diplodocus and Diplodocus. Blog friends can gain knowledge accumulation from it. When Diplodocus was learning ASP before, he didn't seem to pay much attention to this, but now he is trying to make up for it. Okay, let’s go straight to
the vbCr Chr(13) carriage return character.
vbCrLf Chr(13) & Chr(10) carriage return and line feed characters.