|
Subject:
|
really stupid problem with anchor tags
|
|
Posted By:
|
thenoseknows
|
Post Date:
|
8/30/2006 9:57:30 PM
|
This is probably embarrasingly simple, yet I can't seem to figure it out. I have a web.sitemap, and a treeview that binds to that. My client wants internal anchors for a couple of the pages but they don't seem to be working...Here is the relevant part of the web.sitemap:
<siteMapNode url="~/Services/Accounting/Default.aspx" title="Accounting">
<siteMapNode url="~/Services/Accounting/Default.aspx#general" title="General Accounting" />
<siteMapNode url="~/Services/Accounting/Default.aspx#cfo" title="CFO Services" />
<siteMapNode url="~/Services/Accounting/Default.aspx#special" title="Special Project Consulting" />
</siteMapNode>
At the bottom of the page, are three anchor tags that correspond to the links in the web.sitemap. Here is an example of one:
<a name="#general" />
At first I thought turning off MaintainScrollPositionOnBack would fix the problem. Here is my page directive at the top:
<%@ Page Language="VB" MaintainScrollPositionOnPostback="false" MasterPageFile="./accounting.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="Outsourcing_Default" title="Veris > Outsourcing > Accounting & Financial Management" %>
So currently when I click on one of the internal links in the treeview, it does nothing. There is no post back, which is good. It does change the URL in the browsers URL bar, but it doesn't jump the viewport down to where that anchor tag resides.
Neil Timmerman Programmer Veris Consulting
|
|
Reply By:
|
Imar
|
Reply Date:
|
8/31/2006 2:22:49 AM
|
Hi there,
You should drop the # mark from your <a> element:
<a name="general" />
Can you please add a few line breaks here and there when you post code? Thanks,
Imar --------------------------------------- Imar Spaanjaars Everyone is unique, except for me. Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004 Want to be my colleague? Then check out this post.
|
|
Reply By:
|
thenoseknows
|
Reply Date:
|
8/31/2006 9:18:13 AM
|
Imar...thanks! I knew I was doing something stupid.
That "code" button in the editor here prevents wrapping intentionally. While I think thats good for some things (makes it easier to read), I see your point: this one got a little wide. I'll be more mindful of that in the future.
Thanks again.
Neil
Neil Timmerman Programmer Veris Consulting
|
|
Reply By:
|
Imar
|
Reply Date:
|
8/31/2006 9:34:10 AM
|
Yes, correct. For languages where white space is important (Visual Basic for example), the non-wrapping code blocks are a good thing.
But, sometimes the lines get too wide, making it hard to read the page, or answer it.
Don't worry about it too much though....
Imar --------------------------------------- Imar Spaanjaars Everyone is unique, except for me. Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004 Want to be my colleague? Then check out this post.
|