ASP hyperlink (Full Version)

All Forums >> [Web Development] >> ASP and Database



Message


xterradane -> ASP hyperlink (11/14/2001 18:26:00)

I have tried several ways to do a hyperlink using ASP and I can't get any of them to work. This is my latest try. Please help. I want the link to be the Job Title, but to pass the Job ID along to the next page.

This is my error message:

Microsoft VBScript compilation error '800a0401'

Expected end of statement

/webpub/JobSearchResults.asp, line 34

"<TD><a href= " "JobDetails.asp?ID=" & rsJob("ID") &" " ">" & rsJob("JobTitle") &"</a></TD>" &_
----------------^

This is the code:

Do While Not rsJob.EOF
Response.Write _
"<TD><a href= " "JobDetails.asp?ID=" & rsJob("ID") &" " ">" & rsJob("JobTitle") &"</a></TD>" &_
" <TD> " & rsJob("CompanyName") &"</TD>" &_
" <TD> " & rsJob("Location") &"</TD>" &_
" <TD> " & rsJob("LastUpdated") &"</TD>" &_
" </TR>"
rsJob.MoveNext
Loop
Response.Write "</TABLE>"
Else
Response.Write "Your search returned no records."
End If
rsJob.Close
Set rsJob = Nothing





Mojo -> RE: ASP hyperlink (11/14/2001 19:31:00)

"<TD><a href= " "JobDetails.asp?ID=

You have some extra parentheses. Try removing the one I bolded. You also have some string concatenations that are not needed such as:

" <TD> " & rsJob("LastUpdated") &"</TD>" &_
" </TR>"

I would pull the last line to the above line like:
rsJob("LastUpdated") &"</TD></TR>"

It makes for better performance in a high hit site.

Joe





Page: [1]

Valid CSS!




Forum Software © ASPPlayground.NET Advanced Edition 2.4.5 ANSI
0.046875