Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

anchor tag

Status
Not open for further replies.

Pryer

Programmer
Oct 24, 2005
12
US
I am trying to fill a table with a file location that is linked to a pdf file. the following code is what i'm using, but i can't seem to get the correct format. can anyone please help?

thank you,



Code:

<table border="1">
<% do until rs.eof%>

<tr><td width="159" height="41"><div align="center">

'here is where my problem begins...
<a href= <% response.Write rs("location") %>><% Response.Write RS("firstname") %></a>

</div></td>
<td width="10" height="41"><div align="center">
<% Response.Write RS("lastname") %>
</div></td>
<td width="55" height="41"><div align="center">
<% Response.Write RS("age") %>
</div></td></tr>
<% rs.movenext
loop %>
</table>
 
so what does the static output look like sense we will not know what the value of "location" will be or is

Standards!! Quotes

 
the location is the actual file location. My table consists of 3 columns: name, age, location. I want to insert name into one column with a hyperlink to location, which is a link to a pdf file of the person. the second column is age, no links.

does this help at all?
 
try this:

response.write "<a href= """&rs("location")&""">&rs("firstname")&</a>"

hope i dint miss any quotes ;)

-DNG
 
nope. what I was asking was the output that the ASP generated or the static HTML you see when you view the source of the page when you load it.

So in simple terms if you have this

Response.Write RS("location")

so if Tek-Tips was the value in the RS at the cursor you would write out on the page

Tek-Tips

I would read up on coding standards also here W3C

it's more then likely the hint of "Quotes" is your problem. All tag references need quotes around the attributes no matter if it works or not in your browser because it more then likely will break in mine or when you get a qhite space. Also don't forget single quotes ' - could be a big Ouch!

 
or you could get the answer and not learn the trouble shooting part ;)

 
onpnt & dotnetgnat-
thank you for your help, dotnetgnat's solution worked, but i will check out onpnt's link, look like a good start for me.

thank you,

Brenton Pryer
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top