Position page on load and keep state?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 5 of 5

Thread: Position page on load and keep state?

  1. #1
    Saul Guest

    Position page on load and keep state?


    Hi

    My .NET web page consists of several sections, if I scroll down to a section,
    enter some data and hit update, when the page is reloaded it is positioned
    at the top of the page and not on the section I was working on. This is
    confusing for users. How would one do a page load, and postion where it
    was before (say at a specified anchor)- while at the same time maintining
    viewstate on the page (IsPostBack must remain true) - so we can not do a
    Redirect("www.MyPage.com#MyAnchor") - as this will start a fresh instance
    of the page and we loose our state?

    I hoping there is some code I can run in the page load which will jump the
    page to the required position/location.

    Any help apprecaited.
    Thanks
    Saul


  2. #2
    Gorecki Guest

    Re: Position page on load and keep state?


    Interesting situation.
    Maybe you should start thinking in the direction for (what I see) ViewState
    was intended for. Make your form more like a wizard. Have the user fill
    in a few fields of information and NEXT page them to the next layer of information.
    This should eliminate the need for scrolling entirely.

    Just a suggestion.
    Brian

  3. #3
    Russell Jones Guest

    Re: Position page on load and keep state?

    I agree with Gorecki that making a page with several sections is probably
    not the best design; if you want to keep everything on a single page,
    consider changing to a tabbed interface instead. But to solve your problem,
    in IE you can scroll any object on the page into view, placing it at either
    the top or bottom of the window using the scrollIntoView(<start>) method in
    a client-side script. Set start to True (default) to place the top of the
    object at the top of the window, or False to place the bottom of the object
    at the bottom of the window.


    "Gorecki" <gorecki@chm.net> wrote in message
    news:3bb3fcce$1@news.devx.com...
    >
    > Interesting situation.
    > Maybe you should start thinking in the direction for (what I see)

    ViewState
    > was intended for. Make your form more like a wizard. Have the user fill
    > in a few fields of information and NEXT page them to the next layer of

    information.
    > This should eliminate the need for scrolling entirely.
    >
    > Just a suggestion.
    > Brian




  4. #4
    Patrick Long Guest

    Re: Position page on load and keep state?

    there is an option that you can add to the web.config that will turn on a
    code-free feature that automagically positions the user at the last place
    they were in the page after a refresh.

    It only works in IE5 and greater though. I cannot remember what it is i will
    look it up tonight.

    Pat
    "Saul" <skaplan@ozemail.com.au> wrote in message
    news:3bb3ce06$1@news.devx.com...
    >
    > Hi
    >
    > My .NET web page consists of several sections, if I scroll down to a

    section,
    > enter some data and hit update, when the page is reloaded it is positioned
    > at the top of the page and not on the section I was working on. This is
    > confusing for users. How would one do a page load, and postion where it
    > was before (say at a specified anchor)- while at the same time maintining
    > viewstate on the page (IsPostBack must remain true) - so we can not do a
    > Redirect("www.MyPage.com#MyAnchor") - as this will start a fresh instance
    > of the page and we loose our state?
    >
    > I hoping there is some code I can run in the page load which will jump the
    > page to the required position/location.
    >
    > Any help apprecaited.
    > Thanks
    > Saul
    >




  5. #5
    Patrick Long Guest

    Re: Position page on load and keep state?

    the setting is SmartNavigation
    "Patrick Long" <Patrick_long@csi.com> wrote in message news:...
    > there is an option that you can add to the web.config that will turn on a
    > code-free feature that automagically positions the user at the last place
    > they were in the page after a refresh.
    >
    > It only works in IE5 and greater though. I cannot remember what it is i

    will
    > look it up tonight.
    >
    > Pat
    > "Saul" <skaplan@ozemail.com.au> wrote in message
    > news:3bb3ce06$1@news.devx.com...
    > >
    > > Hi
    > >
    > > My .NET web page consists of several sections, if I scroll down to a

    > section,
    > > enter some data and hit update, when the page is reloaded it is

    positioned
    > > at the top of the page and not on the section I was working on. This is
    > > confusing for users. How would one do a page load, and postion where it
    > > was before (say at a specified anchor)- while at the same time

    maintining
    > > viewstate on the page (IsPostBack must remain true) - so we can not do a
    > > Redirect("www.MyPage.com#MyAnchor") - as this will start a fresh

    instance
    > > of the page and we loose our state?
    > >
    > > I hoping there is some code I can run in the page load which will jump

    the
    > > page to the required position/location.
    > >
    > > Any help apprecaited.
    > > Thanks
    > > Saul
    > >

    >
    >




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center