473,320 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Going back to the same location on page after postback or reload.

Hi,

I have a page and if a user posts back data the page would open at the top.
This is not a problem if the user was looking at the content on the top of
the page , but if the page is long and the user was at the bottom of the page
then it looks ugly.

Is there a way IE can go back to the same location after postback or reload?

Thanks
Aug 8 '07 #1
3 4389
To make a single page remember scroll position on postback, set the
MaintainScrollPositionOnPostback attribute in the @Page directive to True.

<%@ Page Language="C#" MaintainScrollPositionOnPostback="true" %>

You can enable the feature for all pages in the site by setting it in the
<pageselement in Web.config.

<pages maintainScrollPositionOnPostBack="true" />
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
bogMetaFinder: http://www.blogmetafinder.com

"mavrick_101" wrote:
Hi,

I have a page and if a user posts back data the page would open at the top.
This is not a problem if the user was looking at the content on the top of
the page , but if the page is long and the user was at the bottom of the page
then it looks ugly.

Is there a way IE can go back to the same location after postback or reload?

Thanks
Aug 9 '07 #2
Thanks Peter,

I'l try that.
"Peter Bromberg [C# MVP]" wrote:
To make a single page remember scroll position on postback, set the
MaintainScrollPositionOnPostback attribute in the @Page directive to True.

<%@ Page Language="C#" MaintainScrollPositionOnPostback="true" %>

You can enable the feature for all pages in the site by setting it in the
<pageselement in Web.config.

<pages maintainScrollPositionOnPostBack="true" />
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
bogMetaFinder: http://www.blogmetafinder.com

"mavrick_101" wrote:
Hi,

I have a page and if a user posts back data the page would open at the top.
This is not a problem if the user was looking at the content on the top of
the page , but if the page is long and the user was at the bottom of the page
then it looks ugly.

Is there a way IE can go back to the same location after postback or reload?

Thanks
Aug 9 '07 #3
Sorry Peter,

But is this attribute available on .net 1.1 or is it just 2.0, cause I'm
using 1.1 and getting an error...

".....attribute is not supported by the 'page' directive"


"Peter Bromberg [C# MVP]" wrote:
To make a single page remember scroll position on postback, set the
MaintainScrollPositionOnPostback attribute in the @Page directive to True.

<%@ Page Language="C#" MaintainScrollPositionOnPostback="true" %>

You can enable the feature for all pages in the site by setting it in the
<pageselement in Web.config.

<pages maintainScrollPositionOnPostBack="true" />
--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
bogMetaFinder: http://www.blogmetafinder.com

"mavrick_101" wrote:
Hi,

I have a page and if a user posts back data the page would open at the top.
This is not a problem if the user was looking at the content on the top of
the page , but if the page is long and the user was at the bottom of the page
then it looks ugly.

Is there a way IE can go back to the same location after postback or reload?

Thanks
Aug 9 '07 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Kim Therkelsen | last post by:
Hi! By pressing a button I am directed from one page to another. At the second page some things displayed on the first page are changed and now I want to go back to the first page again. The...
4
by: nospam | last post by:
HtmlSelect has a method called OnServerChange that supposed to detect whether the control (select) has changed on a postback. This is not all that useful. It should be like the asp.net...
3
by: Brian Henry | last post by:
I have two list boxes on my form... lstCanSend and lstRecipients... well then there are two buttons add and remove between them (your basic select and pick listing) which uses java script to move...
1
by: Johan Nedin | last post by:
Hello! I am having a problem with the @OutputCache page directive and Web browser Back Buttons. Problem: After setting <%@ OutputCache Location="None" %> on my pages I get the "Warning!...
3
by: Vivek | last post by:
Hi all, I have a problem in my web-app wherein I need to get the latest page from server on clicking of back button.. I know that it can be done by preventing/disabling the cache in jsp as ...
6
by: Ralf | last post by:
I have a window where I am adding rows to a table. One of the features is to change a group name for given rows. They want another window to open up to create new groups, edit them, etc. I have...
11
by: C10B | last post by:
hi all, I have 3 drop down lists. When any of them changes there is an auto postback to do some server stuff. It is not always obvious (as a user) that a page reload has been started, and you...
1
by: Rob | last post by:
I know this is an old one, considering how many posts I found on it but I just wondered if any best practises had popped up recently, especially as Ajax has increased JavaScript and DHTML's...
12
by: jim.richardson | last post by:
Hi all, I'd like a page to be excluded from the back button history, that is, when a user hits their browser's back button, it never backs into this particular page. Can anybody please tell...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.