Home > ASP Development > Anchors and such..

Anchors and such..



Hey guys,



I have a <a name='topOfPage'>Top of Page</a> anchor at, obviously, the top of the page. However, all my pages are dynamic and the information is stored in the URL. For some reason my button to head back to the top doesn't work. I'm assuming it's because of the ?caid=85&pgid=609 at the end of the name of the file.



I realise this might not necessarily be an ASP problem but if I can't avoid this I'm probably going to have to program something myself... >.<

    
Guest


for anchor name

Code:


<a name="top"></a>






for actual link for anchor

Code:


<a href="#top">top</a>



Was this answer helpful ? Yes No   
Guest


what does your bookmark link look like?

Was this answer helpful ? Yes No   
Guest


Beercraft... I know how to make the link, I'm saying it's not working...



<a name='topOfPage'>Commission canadienne du lait</a>



<a href='#topOfPage'>Back to top</a>



the url then becomes "index.asp?caid=xx&pgid=yy#topOfPage" but nothing happens, it just stays there.

Was this answer helpful ? Yes No   
Guest


You need it like this

"index.asp#topOfPage?caid=xx&pgid=yy"

Was this answer helpful ? Yes No   
Guest


can i see on the web?

one possible scenario is your page is short so looks like doesn't work

Try make page longer just for testing

Was this answer helpful ? Yes No   
Guest


add the page and request the querystring


Code:



<a href='pagename.asp#topOfPage?<%=Request.QueryString%>'>Back to top</a>



Was this answer helpful ? Yes No   
Guest


actualy this way is fine index.asp?caid=xx&pgid=yy#topOfPage it works on my site without any problems

Was this answer helpful ? Yes No   
Guest


Nah the page scrolls down a good five pages and it just stays at the bottom. I tried werD's code and it brings me to this:



index_fr.asp#topOfPage?caId=87&pgId=494



technically that should work but this is bringing me to a whole other page... :S The string with all the ids is still intact so my code should still detect them just fine without getting confused and spitting me out somewhere else....



Here's how I call it:




Code:


<div id="mid-container" class="clearing">
<div id="nav-col">
<img src="gui_images/<%=strImageName%>_nav.jpg">
<!--#include file="inc/navbar_display.asp"-->
</div>
<div id="content-col">

<div style="width: 450px; /width: 400px; height: 25px; background: url(gui_images/<%=strImageName%>.jpg) no-repeat; margin: 0 0 0 0; padding: 50px 10px 0px 0px; color: #fff; position: relative; font: bold 16px arial, sans-serif; text-align: right;">
<%
if pageTitle <> "" then
response.write(strh1title)
else
response.write("<a name='topOfPage'>Commission canadienne du lait</a>")
end if
%>
</div>
<p><%response.write(strTree)%></p>
<p><h2><%response.write(strh2Title)%></h2></p>
<%response.write(pageContent)%>
<p><a href='index_fr.asp#topOfPage?<%=Request.QueryString%>'>Back to top</a></p>
</div>
</div>



Was this answer helpful ? Yes No   
Guest


Apologies... Beercraft is 100% correct the # sign breaks the querystring and calls the anchor above post should be


Code:



<a href='pagename.asp?<%=Request.QueryString%>#topOfPage'>Back to top</a>




or To not reload the page


Code:



<a href='#topOfPage'>Back to top</a>



Was this answer helpful ? Yes No   
Guest
 
 
Home - About Infoqu - Contact - Privacy Statement - Link to Infoqu - Bookmark Infoqu

Copyright 2007-2008 by Infoqu. All rights reserved