在主页面中维护maintainScrollPositionOnPostback [英] maintainScrollPositionOnPostback in master Page

查看:181
本文介绍了在主页面中维护maintainScrollPositionOnPostback的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以在母版页中设置maintainScrollPositionOnPostback ="true"吗?母版页实际上是一个用户控件(它是从UserControl类派生的).

如果要为所有页面设置,请按照mkgoud的建议在web.config部分中添加此属性.


如果将maintainScrollPositionOnPostback设置为true,则在页面回发后,用户将返回回发之前在浏览器中的相同位置.

如果要在所有页面中保持滚动位置,可以在web.config中设置<pages maintainScrollPositionOnPostBack="True">.




您无法在母版页中执行此操作,因为母版页不是页面",而是用户控件.它仅适用于实际页面.

但是您可以将其设置为头部部分中的单个页面,也可以将其设置为Pages元素中Web.Config文件中的所有页面.


Can I Set maintainScrollPositionOnPostback="true" in master Page?

解决方案

There is no property "maintainScrollPositionOnPostBack" for master page because this property is only for Pages. Master page is a user control actually (It is derived from UserControl class).

If you want to set for all the pages the add this property in the web.config section as mkgoud suggested.


If you set maintainScrollPositionOnPostback to true then after the page postback the user returns to the same position in the browser before the postback.

If you want maintain scroll position in all pages you can set <pages maintainScrollPositionOnPostBack="True"> in web.config.


Hi,

You can''t do that in a Master page, becausemaster page is not a "page" but a user control . It would only work for a actual pages.

But you can set it for one single page in the head secion, or all pages in the Web.Config file in the Pages Element.


这篇关于在主页面中维护maintainScrollPositionOnPostback的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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