Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想打开一个带有特定 div 的 asp.net 网页
就像
<a id="url" href="mypage.aspx#tab1">Home</a>
我想使用
Response.Redirect("mypage.aspx");
不,<div>存在客户端。使用重定向,您只能说应该在新地址再次提交当前请求。您无法指定重定向应在何处结束(frame、iframe、div、window ..)。
<div>
您必须从客户端执行此操作:从某个 url 加载 div(或其他)(可以进行重定向)。
或在mypage.aspx页面内部执行此 JQuery 动画并移动到特定 div
mypage.aspx
$(function(){ $('html, body').animate({ scrollTop: $("#header1").offset().top }); });