2011-05-06 110 views
0

嘿,朋友請幫助我... 我怎麼能寫response.write聲明.....我想把單選按鈕,但threre是一些問題在response.write從記錄集中獲取字符串RSORS ...問題在response.write轉義報價

set ORS = Server.CreateObject("ADODB.recordset") 
getopt="SELECT * FROM Options WHERE QuestionID=" & RS("QuestionID") 
ORS.Open getopt,Conn 

if not ORS.EOF then 
    ORS.movefirst 
    do 
     response.write " <input type='radio' name=' 'Question' & RS('QuestionID')& ''' value='Answer' & ORS('OptionID') & ''' > <h2 >" & ORS("Option") & "</h2><br />" 
     ORS.movenext 
    loop until ORS.EOF 
end if 

RS.movenext 
loop until RS.EOF 

回答

1

使用雙引號"分隔服務器端的字符串,單引號'爲客戶端:

+0

謝謝....男人..它已經解決了我的問題... – Jignesh 2011-05-06 15:39:36

0

有時候最好將長串分成更小,更易管理的塊。嘗試 -

response.write "<input type='radio' name='Question" 
response.write RS("QuestionID") & "' value='Answer" 
response.write ORS("OptionID") & "'> " 
response.write "<h2>" & ORS("Option") & "</h2><br />"