如何在Asp.Net页面中导航位置? [英] How to Navigate Position inside Asp.Net page...?

查看:89
本文介绍了如何在Asp.Net页面中导航位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的页面上有很多控件,然后显然很长..我所有的控件都放在UpdatePanel中.然后,我的问题是,当我单击任何按钮时,它会显示一个位于末页的面板,是否有可能使页面去那个位置?

像html

位置1

位置2

位置3

ddljfldjf
dkhfkldjf

位置1
lfdjld

ldfjld
kljfld
位置2
dkfhkldjfl
ljdflfj
ldhflkjl
位置3

My page Have lot controls then it obviously lengthy..All my controls are placed in UpdatePanel.. Then My problem is when i click any button it make visible a Panel That is at of end page, Is it possible to make page go that position?

Like html

Position 1

Position 2

Position 3

ddljfldjf
dkhfkldjf

Position 1
lfdjld

ldfjld
kljfld
Position 2
dkfhkldjfl
ljdflfj
ldhflkjl
Position 3

推荐答案

即使您的问题不清楚,我也认为应使用CSS来实现这种功能..
Even your question is not clear.. i think you should use css for this type of functionalty..


如果面板中有文本框控件,则可以将焦点设置为该控件(如果要重定向到同一页面).
您还可以使用JavaScript滚动到该位置.

If you are having a textbox control in the panel you can set the focus to that control(if you are redirecting to same page).
You can also use a javascript to scroll to that position.

<asp:Button runat="server" ID="btn1" OnClientClick="pageScroll()" Text="Button" />
<script type="text/javascript">
function pageScroll() {
        window.scrollBy(0,50);

}
</script>



在末页显示一个面板
希望该面板没有隐藏,而您想向下滚动到该面板.
如果该按钮仅用于向下滚动到面板,则可以使用定位标记滚动到所需位置.
<a href="#link1">Position1</a>

<a name="link1"> this放置在面板中或要滚动的位置.



make visible a Panel That is at of end page
Hope the panel is not hidden and you want to scroll down to the panel.
If the button is used only to scroll down to the panel then you can use an anchor tag to scroll to the required position.
<a href="#link1">Position1</a>

Place <a name="link1">this in the panel or where you want to scroll.


这篇关于如何在Asp.Net页面中导航位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆