ASP.NET "To Bottom" hyperlink
On an aspx page I have following hyperlink:
<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="#Bottom" CssClass="ToBottom">To Bottom ↓</asp:HyperLink>
I would like to use it to navigate to the bottom of the page, more specificly, to an anchor with the name "Bottom":
<anchor name="Bottom" />
This doesn't work however... Any suggestions on how to make "To Bottom" and "To Upper" hyperl开发者_如何学Cinks to quickly scroll through the page? Thanks.
**UPDATE:
A regular
<a href="#Bottom" class="ToBottom">To Bottom ↓</a>
Doesn't work either.
This ought to do the trick:
<a href="#Bottom" class="ToBottom">To Bottom ↓</a>
<a name="Bottom" />
I'd recommend using a regular anchor elment for this, there's no use for a server control:
<a href="#Bottom" class="ToBottom">To Bottom</a>
This will work (using href property):
<asp:HyperLink href="#Bottom" runat="server" CssClass="ToBottom">To Bottom</asp:HyperLink>
and building an anchor like:
<a name="Bottom"></a>
精彩评论