How to maintain the scroll position in post back
how to maintain the scroll position on the button click
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Ankur JainRank #2,475 · 567 reputationPosted Aug 6, 2014, 8:51 PM EDT
To maintain the scroll position for the large web page you can use on of these methods :
1- use Web.config page section <pages maintainScrollPositionOnPostBack="true" />
: this will maintains the scroll positions for all the web site pages.
2- in the page declaration <%@ Page MaintainScrollPositionOnPostback="true" %> : this will maintains the scroll position for this page only.
3- programmatically from code behind System.Web.UI.Page.MaintainScrollPositionOnPostBack = true; : this will maintains the scroll position for this page only (the same as page declration).
if its useful,please don't forget to mark it as answer
Niranjan PoddarRank #2,683 · 519 reputationPosted Aug 6, 2014, 11:02 PM EDT
You have to write this code into page load event........
protected void Page_Load(object sender, EventArgs e)
{
MaintainScrollPositionOnPostBack = false;
}
thanks