2013-08-25 80 views
0

我在写一个经典的ASP页面。这条线的工作原理:ASP忽略字符

Response.Write ("<tr>" & vbCrLf) 

我想补充onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';到文本。

我尝试这样做:

Response.Write ("<tr onmouseover="this.style.backgroundColor='#ffff66';" onmouseout="this.style.backgroundColor='#d4e3e5';>" & vbCrLf) 

但它会导致ASP认为部分是注释。我正在寻找忽略字符或正确的代码行。

回答

2

为了逃避引号(“)在VB写两次 在这种情况下

Response.Write ("<tr onmouseover=""this.style.backgroundColor='#ffff66';"" onmouseout=""this.style.backgroundColor='#d4e3e5';"">" & vbCrLf) 

(有。在最后一次也是缺少的qoute)

+0

完美地工作,谢谢! – Kryptos

0

更换内对双引号与双电双引号:

Response.Write ("<tr onmouseover=""this.style.backgroundColor='#ffff66';"" onmouseout=""this.style.backgroundColor='#d4e3e5';"">" & vbCrLf)