开发者

ASP.NET Navigate to section on page (help files)

I am writing a help page with sections. What I want to do is allow navigation to a particular section (depending on what page the user clicked help from) rather than always landing at the top of the page.

My web app is written in ASP.NET; can 开发者_JS百科anyone point me in the direction of how to set this up? Thanks!


You should use "bookmarks" for this... for example:

<a href="yourpage.aspx#Help">Help</a>

Will take you to the following "bookmark" on the yourpage.aspx page...

<a id="Help"></a>

Update! The name attribute should not be used for this, as per the W3C HTML5 recommendation.

Authors should not specify the name attribute on a elements. If the attribute is present, its value must not be the empty string and must neither be equal to the value of any of the IDs in the element's home subtree other than the element's own ID, if any, nor be equal to the value of any of the other name attributes on a elements in the element's home subtree. If this attribute is present and the element has an ID, then the attribute's value must be equal to the element's ID. In earlier versions of the language, this attribute was intended as a way to specify possible targets for fragment identifiers in URLs. The id attribute should be used instead.


You need to use the <a name="xxx"> tag.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜