Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Going back to the same location on page after postback or reload.

Reply
Thread Tools

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

 
 
=?Utf-8?B?bWF2cmlja18xMDE=?=
Guest
Posts: n/a
 
      08-08-2007
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
 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      08-09-2007
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



"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

 
Reply With Quote
 
 
 
 
=?Utf-8?B?bWF2cmlja18xMDE=?=
Guest
Posts: n/a
 
      08-09-2007
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
> <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
>
>
>
> "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

 
Reply With Quote
 
=?Utf-8?B?bWF2cmlja18xMDE=?=
Guest
Posts: n/a
 
      08-09-2007
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
> <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
>
>
>
> "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

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Firefighters at the site of WTC7 "Move away the building is going to blow up, get back the building is going to blow up." Midex Python 24 05-07-2007 04:23 AM
Location, location, location =?Utf-8?B?VHJhY2V5?= Wireless Networking 2 02-17-2007 08:37 PM
avoid a page going back to site after logging out nvv via DotNetMonster.com ASP .Net 2 01-27-2005 09:12 PM
Set page to focus some certain location after post back Hardy Wang ASP .Net 4 12-09-2004 03:03 PM
After PostBack - back to same place on page tshad ASP .Net 12 11-02-2004 01:30 AM



Advertisments