Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4057206
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T14:55:25+00:00 2026-05-20T14:55:25+00:00

I have a gridview that putted in ASP.NET Panel. both of panel and Gridview

  • 0

I have a gridview that putted in ASP.NET Panel.
both of panel and Gridview are in an UpdatePanel.
there is a column in gridview that Causes Partial PostBacks.
i want to Maintain Panel Scroll position on those postbacks.
Is there any way?
regards.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-20T14:55:25+00:00Added an answer on May 20, 2026 at 2:55 pm

    There is no built-in facility to resolve it in asp.net

    However, there is a workaround for this problem; You need to handle it with javascript.

    Solution is mentioned here: Maintain Scrollbar Position Inside UpdatePanel After Partial PostBack

    Edited 20-May-2012; after seeing the comments

    <form id="form1" runat="server">
      <asp:ScriptManager ID="ScriptManager1" runat="server" ScriptMode="Release" />
       <script type="text/javascript">
          // It is important to place this JavaScript code after ScriptManager1
          var xPos, yPos;
          var prm = Sys.WebForms.PageRequestManager.getInstance();
    
          function BeginRequestHandler(sender, args) {
            if ($get('<%=Panel1.ClientID%>') != null) {
              // Get X and Y positions of scrollbar before the partial postback
              xPos = $get('<%=Panel1.ClientID%>').scrollLeft;
              yPos = $get('<%=Panel1.ClientID%>').scrollTop;
            }
         }
    
         function EndRequestHandler(sender, args) {
             if ($get('<%=Panel1.ClientID%>') != null) {
               // Set X and Y positions back to the scrollbar
               // after partial postback
               $get('<%=Panel1.ClientID%>').scrollLeft = xPos;
               $get('<%=Panel1.ClientID%>').scrollTop = yPos;
             }
         }
    
         prm.add_beginRequest(BeginRequestHandler);
         prm.add_endRequest(EndRequestHandler);
     </script>
    
     <asp:UpdatePanel ID="UpdatePanel1" runat="server">
       <ContentTemplate>
         <asp:Panel ID="Panel1" runat="server" Height="300">
            <%-- Some stuff which would cause a partial postback goes here --%>
         </asp:Panel>
       </ContentTemplate>
     </asp:UpdatePanel>
    
    </form>
    

    Below is the code snapshot:-

    Maintain Scrollbar Position Inside UpdatePanel After Partial PostBack

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm using the ASP net Ajax toolkit and have a GridView within the UpdatePanel
I have a GridView that allows editing the values in every column, in every
I have a gridview that is bound to a datasource (Windows Forms, VB.NET). One
I have a gridview that is populated by a dataset and I want to
I have a gridview that takes in values from a sortedlist. I want to
I have a GridView that I want to be 4 equally sized TextViews in
I have a gridview that fill it with some data. <asp:GridView ID=GridView1 runat=server ClientIDMode=Static>
I have a Gridview that I want to filter. My gridview is in an
I have a gridview that it bind to a data table.I want to add
I have a gridview that is databound to a XmlDataSource. I also want to

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.