Holding scroll position using .net and CSS overflow on postback...which technology?
Hi, I am a newbie here and have a problem that is above my current tech level. I am hoping to find some help/suggestions.
My front page is an asp.net webform with two form controls: a sidebar, and a general form control that displays dynamic web content. Within the sidebar control I am using the standard HTML UL/LI list syntax to list all of the categories on my site. E.g.: apparel, electronics, etc... User clicks on the sidebar and is sent to the control that displays the dynamic content.
I am using a CSS div that has the overflow set to auto in the sidebar control. When user clicks on one of the categories within the sidebar, the whole page resets the two controls and sends the sidebar's position back to the top. Problem is that the sidebar is many pages long and if the user is browsing, he will have to re scroll down to the position where they clicked.
You could do something like Wikipedia does. At the top of each page, Wikipedia has links and when clicked, it sends you down to the part of the page you wanted.
It's done by doing the following.
When you click the link in your example, the URL will have it go down to where it's supposed to go, that way, the user won't have to resscroll. The key is to make sure the anchor hash tag marks the elements name="" and the element has the name="" set.
I don't know if this is feasible or not for you due to me not knowing the specific workings, but perhaps you can try that out.
Well.. as I have admitted in my first post asking for help on this website.. I'm crap at css... but your problem is easy for an asp.net programmer... have a look at "MaintainScrollPositionOnPostback".. What this does basically is it remembers the page postion
after postback for you.