前台:
<a id="HtmlControlBookMark" runat="server" name = '<%# DataBinder.Eval(Container.DataItem, "SiteName")%>'>
</a>
</a>
后台方法:
/// <summary>
/// 页面定位到设置锚点的地方
/// </summary>
/// <param name="bookMark">设置锚点的地方</param>
private void GoToBookMark(string bookMark)
{
Page.RegisterStartupScript("bookmark", "<script>location.href('" + "#"
+ bookMark + "');</script>");
}
/// 页面定位到设置锚点的地方
/// </summary>
/// <param name="bookMark">设置锚点的地方</param>
private void GoToBookMark(string bookMark)
{
Page.RegisterStartupScript("bookmark", "<script>location.href('" + "#"
+ bookMark + "');</script>");
}