ASP-code i Response.Write [
Besvar ]
Av: Lars Espen Bøkseth<select name="Colour" >
<%
While (NOT ColoursRS.EOF)
%>
<option value="<%=(ColoursRS.Fields.Item("Colour").Value)%>" ><%= (ColoursRS.Fields.Item("Colour").Value)%></option>
<%
ColoursRS.MoveNext()
Wend
If (ColoursRS.CursorType > 0) Then
ColoursRS.MoveFirst
Else
ColoursRS.Requery
End If
%>
</select>
Jeg har behov for å få denne koden til å bli skrevet via Response.Write.
Har kommet så langt:
Response.Write "<select name='Colour'>" & "While" & "(Not ColourRS.EOF)" & vbcrlf
Response.Write "<option value=" & (ColoursRS.Fields.Item("Colour").Value) & ">" & (ColoursRS.Fields.Item("Colour").Value) & "</option>" & vbcrlf
Response.Write "ColourRS.MoveNext()" & Wend If & "(ColoursRS.CursorType > 0)" & Then & "ColoursRS.MoveFirst" & Else & "ColoursRS.Requery" & End If
Response.Write "</select>"
men får da feilmelding på Response.Write "ColourRS.MoveNext()..."
Feilmeding:
Microsoft VBScript compilation error '800a03ea'
Syntax error
og peker til Wend If på samme linje.
Jeg ønsker dette i en Response.Write da jeg kjører dette i en
if then else.
if Products("ProductID") = "146" then
Response.Write " "
Else
Response.Write "<select name='Colour'>" & "While" & "(Not ColourRS.EOF)" & vbcrlf
Response.Write "<option value=" & (ColoursRS.Fields.Item("Colour").Value) & ">" & (ColoursRS.Fields.Item("Colour").Value) & "</option>" & vbcrlf
Response.Write "ColourRS.MoveNext()" & Wend If & "(ColoursRS.CursorType > 0)" & Then & "ColoursRS.MoveFirst" & Else & "ColoursRS.Requery" & End If
Response.Write "</select>"
Noen som har forslag til hvordan dette kan løses?
Takknemmelig for all hjelp!