Programmatically scroll to an Anchor Tag

前端 未结 8 1597
孤独总比滥情好
孤独总比滥情好 2020-11-28 07:21

Consider the following code:

GoTo Label2
... [content here] ...
More content


        
8条回答
  •  忘掉有多难
    2020-11-28 07:41

    Using javascript:

    window.location.href = '#label2';
    

    If you need to do it from the server/code behind, you can just emit this Javascript and register it as a startup script for that page.

提交回复
热议问题