ibrahimjan Posted July 28, 2011 Share Posted July 28, 2011 HI ALLI need help with the following code, please excuse my lack of knowledge in asp, I need to repeat a record and pass it to an object as shown, but I cant get the repeat nesting to work correctly, can you please advice, how i can make it work correctly.thank you<%Dim HEADDim Repeat3__numRowsDim Repeat3__indexWhile ((Repeat3__numRows <> 1) AND (NOT text_head.EOF))HEAD = (text_head.Fields.Item("head_TX").Value)Repeat3__index=Repeat3__index+1Repeat3__numRows=Repeat3__numRows-1text_head.MoveNext()Wend%><object type="image/svg+xml" data="/gallery/svg/layout1.svg" width="500" height="640"> <param name="text-label1" value="<%=HEAD%>" /><param name="text-label3" value="<%=HEAD%>" /></object> Link to comment Share on other sites More sharing options...
justsomeguy Posted July 28, 2011 Share Posted July 28, 2011 It looks like you need a response.write statement inside the loop to write out a param tag for each item. Link to comment Share on other sites More sharing options...
ibrahimjan Posted July 28, 2011 Author Share Posted July 28, 2011 Hi I did it this way with the response.write inside the object, but still not paging through the table, its displaying the same row in head_TX??<object type="image/svg+xml" data="/gallery/svg/layout1.svg" width="500" height="640"><%Dim HEADDim Repeat3__numRowsDim Repeat3__indexHEAD = (text_head.Fields.Item("head_TX").Value)While ((Repeat3__numRows <> 1) AND (NOT text_head.EOF))Response.Write "<param name=""text-label1"" value="""& HEAD &""" />"Repeat3__index=Repeat3__index+1Repeat3__numRows=Repeat3__numRows-1text_head.MoveNext()Wend%></object> Link to comment Share on other sites More sharing options...
justsomeguy Posted July 28, 2011 Share Posted July 28, 2011 Now you moved HEAD out of the loop. The line where you assign HEAD, and the line where output HEAD, both need to be inside the loop. The loop is supposed to get the new value and write it out, not one or the other. In your first piece of code you were getting all of the values, but then writing only one, and in the second version you only get one value, then write it out several times. The loop needs to both get the value, and write it. Link to comment Share on other sites More sharing options...
ibrahimjan Posted July 28, 2011 Author Share Posted July 28, 2011 Thank you very much all is working fine now. Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.