Forums
This topic is locked
I need help with anchors in my ASP pages
Posted 26 Sep 2001 17:21:13
1
has voted
26 Sep 2001 17:21:13 Zain Magsi posted:
Hi,I am trying to use anchors in my asp pages. I am not sure if that is possible. But anyway: I have a page that lists all the titles of articles in my access db. there is another page that has all the articles listed in detail. I want that, when some one clicks on a title on the list page, they will go to the detail page and scroll to the partiqular news article. Also both pages use the same recordsets.
Here is what the current link looks like on the "list" page in a repeat region:
<A HREF="temsnews-prod.asp?<%= MM_keepNone & MM_joinChar(MM_keepNone) & "title=" & tableprod.Fields.Item("title".Value %>" target="_parent"><%=(tableprod.Fields.Item("title".Value)%></A>
Here is what the code looks like on the "detailed listing" page":
<table width="100%" border="0" cellpadding="2">
<tr>
<td valign="top">
<div align="left"></div>
<p align="left">
<%language="VBScript"
response.write "<!--TEMS News-->"
sqlstr = "SELECT TOP " & numItems & " * FROM news WHERE category = 'general' ORDER BY date DESC, time DESC"
Set rsnews = news.Execute(sqlstr)
If Err.Number <> 0 Then
response.write "Couldn't exec SQL query"
response.end
End If
If rsnews.EOF Then
response.write "No records found... DB corrupt?"
response.end
End If
Function to_html(s_string)
to_html = Replace(s_string, vbcrlf, "<br>"
to_html = Replace(to_html, """", """
End Function
rsnews.moveFirst
Dim db
While Not rsnews.EOF
s_message=rsnews.fields("news"
s_message2=to_html(s_message)
s_message3=to_html(s_message)
If rsnews.fields("urls" = "1" THEN
s_message3 = edit_hrefs(s_message2)
End if
currdate = FormatDateTime(rsnews.fields("date", 1)
if db <> currdate then
%>
</p>
<div align="left">
<p><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><b><font size="1"><i>
<%
db = currdate
end if
%>
</i></font></b></font></p>
<p> </p>
<table width="100%" cellspacing="0" cellpadding="2" border="0">
<tr bgcolor="#EAEAEA">
<td align="left" colspan="2">
<div align="left"> <font face="Verdana, Arial, Helvetica, sans-serif" size="2"><strong><strong>
//I want the anchor to go here
<%=rsnews.fields("title"%></strong></strong></font><font face="Verdana, Arial, Helvetica, sans-serif" size="2" color="#000000">
</font></div></td>
<tr>
<td align="left" width="395"><font face="Verdana, Arial, Helvetica, sans-serif" color="#000000"><font><font size="1" color="#333333">Posted
on</font> <font size="1" color="#333333">(
<%
response.write currdate
%>
) </font></font></font></td>
<td align="right" width="141"><font color="#000000"></font></td>
</table<font size="2" face="Verdana, Arial, Helvetica, sans-serif">
<font size="1">
<%Response.Write s_message3%>
</font></font> <font size="1" face="Verdana, Arial, Helvetica, sans-serif">
</font> <font size="1" face="Verdana, Arial, Helvetica, sans-serif
<%
rsnews.moveNext
Wend
%>
</font><font size="2" face="Verdana, Arial, Helvetica, sans-serif">
</font></div>
</td>
</tr>
</table>
Can you help me with this. If this is not possible, is there another way around it?
Thanks
Zain
Zain Magsi