473,409 Members | 2,022 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,409 software developers and data experts.

How remember page position on postback

I have a long form. When I click the submit button at the bottom the page
does some validation. But, it always refreshes and the page is at the "top"
again. How can I have it "retain" it's scroll position?

I set the page directive of Enable View State to true but tht didn't help.

Thanks.
Oct 1 '08 #1
4 4009
In the @Page directive, include MaintainScrollPositionOnPostback="true"
--
Nathan Sokalski
nj********@hotmail.com
http://www.nathansokalski.com/

"Bobby Edward" <bo***@nobody.comwrote in message
news:eB**************@TK2MSFTNGP04.phx.gbl...
>I have a long form. When I click the submit button at the bottom the page
does some validation. But, it always refreshes and the page is at the
"top" again. How can I have it "retain" it's scroll position?

I set the page directive of Enable View State to true but tht didn't help.

Thanks.

Oct 1 '08 #2
The ViewState won't have anything to do with the page position, it just
stores data used by the controls on a page. Try enabling SmartNavigation on
the page instead. This works best in IE from the reports I've heard. I can't
confirm myself whether or not it works with non-IE browsers since I don't
use SmartNavigation.

Hope this helps,
Mark Fitzpatrick

"Bobby Edward" <bo***@nobody.comwrote in message
news:eB**************@TK2MSFTNGP04.phx.gbl...
I have a long form. When I click the submit button at the bottom the page
does some validation. But, it always refreshes and the page is at the
"top" again. How can I have it "retain" it's scroll position?

I set the page directive of Enable View State to true but tht didn't help.

Thanks.
Oct 1 '08 #3
"Nathan Sokalski" <nj********@hotmail.comwrote in message
news:e0**************@TK2MSFTNGP03.phx.gbl...
In the @Page directive, include MaintainScrollPositionOnPostback="true"
I tried this but it didn't work. :(

This is a page that is using a master page. Does that make a difference?

Thanks!
Oct 1 '08 #4
"Bobby Edward" <bo***@nobody.comwrote in message
news:e7**************@TK2MSFTNGP06.phx.gbl...
>In the @Page directive, include MaintainScrollPositionOnPostback="true"

I tried this but it didn't work. :(

This is a page that is using a MasterPage. Does that make a difference?
It does. There are additional considerations when using
MaintainScrollPositionOnPostback with MasterPages - discussed here:
http://www.google.co.uk/search?sourc...ack+MasterPage
--
Mark Rae
ASP.NET MVP
http://www.markrae.net

Oct 1 '08 #5

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

Similar topics

3
by: Ron Wallegie | last post by:
I developed a webesite using c#. I have a dropdownlist wich is filled with database values. When i click on a button on the same page all values are lost in the dropdownlist. The most common...
3
by: Chung | last post by:
Hi all, I have used the following code for doing the form submission. I don't think this is a right way to submit a from to a new aspx page because I need to add a dummy form in between. Could...
4
by: Bas Groeneveld | last post by:
I am developing an ASP.NET application part of which consists of a data entry wizard defined by entries in a data table - ie the controls on each page of the wizard are determined by definitions in...
13
by: tshad | last post by:
I have some nested DataGrids in my Datalist. There could be 20 datalist items. If I scroll down to the 18th item and expand it to show the DataGrid, the page always goes back to the beginning...
2
by: ChucRock | last post by:
Hi, I have the following code where there is some client side VBScript that does something and needs to pass a variable back to the ASP.NET page. When the page is updated through a postback, the...
9
by: McGeeky | last post by:
Is there a way to get a user control to remember its state across pages? I have a standard page layout I use with a header and footer as user controls. Each page uses the same layout by means of...
5
by: RobertK | last post by:
I have a table that displays one row of images (thumbnails). When a user clicks on an image it opens up a bigger image below it. The row has about 20 cells. I have a <divtag which allows the user...
4
by: bendlam | last post by:
I have a page that contains search criteria and when you click on the search button it causes a post back that populates a dataview on the same page. One of the gridview columns contains a link...
2
by: =?Utf-8?B?ZWdzZGFy?= | last post by:
Hello, i have implemented a button in some other pages that calls another one, the problem is that everytime I hit the button he goes for the postback code and I already disable that part. this is...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.