response.write
语句.....我想放置单选按钮但是response.write
中的某些问题是从记录集RS
和ORS
中获取字符串...
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
答案 0 :(得分:1)
使用双引号"
分隔服务器端字符串,并使用单引号'
为客户端:
response.write " <input type='radio' name='Question" & RS("QuestionID") & "' value='Answer" & ORS("OptionID") & "'> <h2>" & ORS("Option") & "</h2><br />"
答案 1 :(得分: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 />"