Set MaintainScrollPositionOnPostBack  to True for all pages in app

Posted on 2007-08-01
Last Modified: 2008-02-01
Ho do I set MaintainScrollPositionOnPostBack  to tru for all pages in my app? according to this article ( ) it is part of the pages tag in web.config, but I just get an unidentified arguement error when I put it there?

Question by:bhermer
    LVL 15

    Expert Comment

    How about SmartNavigation?
    LVL 37

    Expert Comment

    >>but I just get an unidentified arguement error when I put it there?
    is this for a 2.0 application?
    LVL 4

    Author Comment

    yes ASP 2, works fine in a partial class file.
    LVL 4

    Author Comment

    AS for SmartNavigation I dont know how tat works, I have always used MaintainScrollPositionOnPostBack  on a page by page basis, I happen to be doing a site at the mo that needs it on every page, just thought it would be nice to set it globally
    LVL 16

    Accepted Solution

    The web.config file is case sensitive. Make sure you are using it in the <pages> element as "maintainScrollPositionOnPostBack" with a lowercase "m".
    LVL 4

    Author Comment

    ;) cheers TSmooth, points are yours!  

    FYI readers, my pages tag in web.config is this below

       <pages maintainScrollPositionOnPostBack = "True">
                            <add namespace="System"/>
                            <add namespace="System.Collections"/>
                            <add namespace="System.Collections.Specialized"/>
                            <add namespace="System.Configuration"/>
                            <add namespace="System.Text"/>
                            <add namespace="System.Text.RegularExpressions"/>
                            <add namespace="System.Web"/>
                            <add namespace="System.Web.Caching"/>
                            <add namespace="System.Web.SessionState"/>
                            <add namespace="System.Web.Security"/>
                            <add namespace="System.Web.Profile"/>
                            <add namespace="System.Web.UI"/>
                            <add namespace="System.Web.UI.WebControls"/>
                            <add namespace="System.Web.UI.WebControls.WebParts"/>
                            <add namespace="System.Web.UI.HtmlControls"/>

    Featured Post

    Free Trending Threat Insights Every Day

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    What is Node.js? Node.js is a server side scripting language much like PHP or ASP but is used to implement the complete package of HTTP webserver and application framework. The difference is that Node.js’s execution engine is asynchronous and event…
    International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
    Viewers will learn one way to get user input in Java. Introduce the Scanner object: Declare the variable that stores the user input: An example prompting the user for input: Methods you need to invoke in order to properly get  user input:
    The viewer will learn the benefit of using external CSS files and the relationship between class and ID selectors. Create your external css file by saving it as style.css then set up your style tags: (CODE) Reference the nav tag and set your prop…

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now