我正在使用VS2010 / C#来开发我的ASP.NET Web项目。我希望我的用户在点击按钮后查看页面底部。我怎么能这样做?我可以使用JavaScript,如果是,我应该使用什么功能?
答案 0 :(得分:5)
使用Anchor标签?
链接
<a href="#bottom">bottom</a>
这将位于页面底部:
<a name="bottom"></a>
如果您希望在像<asp:button>
这样的ASP.NET控件上使用此行为而不是按钮的常规链接,那么在代码隐藏中的PostBack上,您需要执行以下操作吐出一些JavaScript来将用户跳到那个位置。
ClientScript.RegisterStartupScript(this.GetType(), "Anchor", "location.hash = '#bottom';", true);
答案 1 :(得分:0)
使用html anchor标记链接到页面底部的锚点。
答案 2 :(得分:0)