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

G

Guest

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
 
G

Guest

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
<pages> element in Web.config.

<pages maintainScrollPositionOnPostBack="true" />
 
G

Guest

Thanks Peter,

I'l try that.


Peter Bromberg said:
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
<pages> element in Web.config.

<pages maintainScrollPositionOnPostBack="true" />


--
Recursion: see Recursion
site: http://www.eggheadcafe.com
unBlog: http://petesbloggerama.blogspot.com
bogMetaFinder: http://www.blogmetafinder.com
 
G

Guest

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"
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top