如何在经典asp中使用<a href=""></a>?

时间:2011-12-22 06:16:32

标签: asp-classic

我有三列第(0)列,第(1)列,第(2)列,我希望在以下代码中为这三行提供标记:“strNewContents = strNewContents&amp;”“&amp; columns(0) &amp;“”&amp; columns(1)&amp;“”&amp; columns(2)&amp;“”&amp; vbcrlf:“

实际代码:

Dim strFileName1
Dim objFSO, objTextFile
Dim intLineNumber, strNewContents, strReadLineText,strLineNumbers
dim data, columns

strFileName1 = "saveimagename.txt"

Const ForReading = 1
Const ForWriting = 2

Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objTextFile = objFSO.OpenTextFile(Server.MapPath(strFileName1))

intLineNumber = 0
strLineNumbers = ""

data = split(objTextFile.readall(), vbcrlf)

for intLineNumber = 0 to ubound(data)
    columns = split(data(intLineNumber), ",", 3)
    if (ubound(columns) = 2) then
       ''//strNewContents =  "<td class='red'>" & columns(0) & "</td><td class='blue'>" & columns(2) & "</td>" 
       strNewContents = strNewContents & "<tr><td>" & columns(0) & "</td><td>" & columns(1) & "</td><td>" & columns(2) & "</td></tr>" & vbcrlf
    end if
next

1 个答案:

答案 0 :(得分:5)

您已使用Response.Write字符串。

你只是:

Response.Write "<a href=""" & link & """>" & linkName & "</a>"