Tip #75: Did you know…How to maintain scrollposition after post back?

简介: When web pages are posted back to the server, by default user is returned to the top of the page. On a large web page, you might have a requirement t...

When web pages are posted back to the server, by default user is returned to the top of the page. On a large web page, you might have a requirement to scroll down the user automatically to the last position on the page.

MaintainScrollPositionOnPostBack page property can be used to achieve this  in one of the following ways. 

  1. Application level: To set the property by default for all pages in the website, open web.config and add the attribute to the pages node.

    <pages maintainScrollPositionOnPostBack="true">

  2. Page Level: for a particular page, open the aspx and set the property

    <%@ Page MaintainScrollPositionOnPostback="true" ...

  3. Code level: to set the property programmatically

    Page.MaintainScrollPositionOnPostBack = true;

Hope this helps.

Deepak Verma 

相关文章
|
4月前
|
小程序
报错:Now you can provide attr `wx:key` for a `wx:for` to improve performance
报错:Now you can provide attr `wx:key` for a `wx:for` to improve performance
|
Web App开发 安全
Not allowed to navigate top frame to data URL
Not allowed to navigate top frame to data URL
312 0
SAP IDoc Post不成功,报错 - A company code cannot be determined for LI 0000100061 –
SAP IDoc Post不成功,报错 - A company code cannot be determined for LI 0000100061 –
SAP IDoc Post不成功,报错 - A company code cannot be determined for LI 0000100061 –
A small tip to explore how to call a method of a control
Created by Jerry Wang, last modified on Mar 20, 2015
127 0
A small tip to explore how to call a method of a control
Multiple Origin composition test - Opportunity Creation case
Sent: Wednesday, 3 December, 2014 2:48 PM 结论是:如果gateway系统上针对一个odata service维护了多个mark成default的backend system,在creation的case下,runtime时候gateway只会向第一个 Default system发起请求。
Multiple Origin composition test - Opportunity Creation case
Fiori Elements detail table data request logic
Fiori Elements detail table data request logic
115 0
Fiori Elements detail table data request logic
header note truncation issue - designed behavior
header note truncation issue - designed behavior
102 0
header note truncation issue - designed behavior
SAP Fiori Elements - fixed value help data request and how drop down list entry is rendered
SAP Fiori Elements - fixed value help data request and how drop down list entry is rendered
112 0
SAP Fiori Elements - fixed value help data request and how drop down list entry is rendered
2015-03-18 header note creation in my Appointment
2015-03-18 header note creation in my Appointment
94 0
2015-03-18 header note creation in my Appointment
|
JavaScript jenkins 持续交付
Solution for Lead OPA test error ( add button clicked after cancel button )
Solution for Lead OPA test error ( add button clicked after cancel button )
127 0
Solution for Lead OPA test error ( add button clicked after cancel button )