Hai all I am new to ASP. In my ASP project i am trying to populate a table with certain records that i fetched from a database table .. the code is as below <%rs.movefirst DO UNTIL rs.eof i = i + 1 %> <TR> <td><%=i%></td> <td><A HREF =U_ViewTransDet.asp><%=rs(0)%></A></td> <td><%=rs(1)%></td> <td><%=rs(2)%></td> </TR> Here the second colum in my table is given as link Let the column values be 1 234 a 23 2 267 g 24 3 290 f 21 The values 234, 267, 290 are displayed as links in the table. and when i click on the link 267 it shud be redirected to a page named "U_ViewTransDet.asp" along with the value 267. How can i do this ? its very urgent .. plz help ..
Replace <td><A HREF =U_ViewTransDet.asp><%=rs(0)%></A></td> With <td><a href="U_ViewTransDet.asp?value=<%=rs(0)%>"><%=rs(0)%>></a</td>
slight typo in that response, should be: <td><a href="U_ViewTransDet.asp?value=<%=rs(0)%>"><%=rs(0)%></a></td> Code (markup):
<% rs.MoveFirst Do Until rs.EOF i = i + 1 %> <tr> <td><%=i%></td> <td><a href="U_ViewTransDet.asp?value=<%=rs(0)%>"><%=rs(0)%></a></td> <td><%=rs(1)%></td> <td><%=rs(2)%></td> </tr> <% Loop %> Code (markup): That should work
I agree to the the examples given previously... But, DO NOT use DO While for looping thru recordsets.. . use getrows!