PDA

View Full Version : ASP recordset Link


rico1931
09-11-2008, 07:48 PM
Howdy there folks!
I got the following piece of code in a table and would like to make whats inside the table into a link:

<td><%=(rsDevices.Fields.Item("Device IP").Value)%></td>


I have tried the following

<td><a href = "<%=(rsDevices.Fields.Item("Device IP").Value)%>"><%=(rsDevices.Fields.Item("Device IP").Value)%></a> </td>


But this makes the link but it keeps the hieracry and want this to open in a new window. Mind you that this information is being gotten from a recordset.

Thanks for your help!

edbr
09-12-2008, 01:47 AM
what is the value? an example maybe.

rico1931
09-12-2008, 03:02 AM
its a repeating record so the value is what is stored in the DB table an example would be one column has names and the other has email address I want to make email address table links but the way it is set up in DW is that its a repeating record so it goes through the DB till it runs out of rows to fill. The links are easy to create when just txt is put in with no asp. I just want to know how to make ASP code into links

lux
09-12-2008, 10:30 AM
to open a link in a new window include target="_blank" inside the <a> tag

rico1931
09-13-2008, 05:22 PM
right but if you have a record set with an <a> tag like the one i posted above

<td>
<a href = "<%=(rsDevices.Fields.Item("Device IP").Value)%>">
<%=(rsDevices.Fields.Item("Device IP").Value)%></a>
</td>

it disappears.

edbr
09-15-2008, 01:36 AM
which was why I asked what the values were

rico1931
09-18-2008, 05:33 PM
<td><input type = "hidden" name="Device IP" value="<%=(rsDevices.Fields.Item("Device IP").Value)%>"/>
<a href="http://<%=(rsDevices.Fields.Item("Device IP").Value)%>" target="_blank">
<%=(rsDevices.Fields.Item("Device IP").Value)%>
</a>
</td>
This is the answer on how to get a record set to display links in a dif window. Say you have a DB with 20 items and have a record set and rs navigation buttons to scroll through 5 itsma at a time. Within the record set there will be links in some colume you may want. Edit, ip address, anything you want as a link. This allows you to put links on txt in your DB so you don't have to hand code for every single item somehow.

Hope this helps the forum!