none
How can put MaintainScrollPositionOnPostBack=True in a WebPart RRS feed

  • Question

  • I have a page with two webparts with connected lists. I want to fix the scroll of webpart if I select one item from one list.   Else I must always scroll the webpart to find the next item. I have found in internet a command "MaintainScrollPositionOnPostBack=True", but I can only put it in the page. How can I put in in two webparts?
    • Moved by Mike Walsh FIN Friday, September 2, 2011 10:47 AM customization (?) (From:SharePoint - Setup, Upgrade, Administration and Operation (pre-SharePoint 2010))
    Friday, September 2, 2011 9:26 AM

Answers

  • Hi,

    Could I confirm with you that you added this.Page.MaintainScrollPositionOnPostBack = true; to the CreateChildControls() method of your custom web part. To the web.config file, find pages tag in <system.web> section, add maintainScrollPositionOnPostBack="true” in the tag and save.

    Thanks,
    Qiao Wei

    • Marked as answer by Emir Liu Monday, September 19, 2011 10:09 AM
    Friday, September 16, 2011 9:09 AM
    Moderator

All replies

  • In a web part

    this.Page.MaintainScrollPositionOnPostBack = true;

    In the web.config of web application.

    <system.web>
      <pages maintainScrollPositionOnPostBack="true">
      </pages>
    </system.web>


    w: http://www.worldofsharepoint.com | t: @sharesandip
    Friday, September 2, 2011 9:42 AM
  • Thank you for the answer. But can you tell me Where can I find the web.config of web application?
    Wednesday, September 7, 2011 2:37 PM
  • Hello,

    I have put it in web.config, but I get the error:

    <!-- Web.Config Configuration File -->
    
    
    
    
    
    
    
    <configuration>
    
    
    
        <system.web>
    
    
    
            <customErrors mode="Off"/>
    
    
    
        </system.web>
    
    
    
    </configuration>


    Notes: The current error page you are seeing can be replaced by a custom error page by modifying the "defaultRedirect" attribute of the application's <customErrors> configuration tag to point to a custom error page URL.

    <!-- Web.Config Configuration File -->
    
    
    
    
    
    
    
    <configuration>
    
    
    
        <system.web>
    
    
    
            <customErrors mode="RemoteOnly" defaultRedirect="mycustompage.htm"/>
    
    
    
        </system.web>
    
    
    
    </configuration>

     

     



    • Edited by hulu0808 Friday, September 16, 2011 9:54 AM
    Wednesday, September 7, 2011 2:57 PM
  • Hi,

    Could I confirm with you that you added this.Page.MaintainScrollPositionOnPostBack = true; to the CreateChildControls() method of your custom web part. To the web.config file, find pages tag in <system.web> section, add maintainScrollPositionOnPostBack="true” in the tag and save.

    Thanks,
    Qiao Wei

    • Marked as answer by Emir Liu Monday, September 19, 2011 10:09 AM
    Friday, September 16, 2011 9:09 AM
    Moderator