HighTechTalks DotNet Forums  

Position in Page after a "Submit"

ASP.net Building Controls microsoft.public.dotnet.framework.aspnet.buildingcontrols


Discuss Position in Page after a "Submit" in the ASP.net Building Controls forum.



Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old   
Paul
 
Posts: n/a

Default Position in Page after a "Submit" - 08-16-2006 , 06:42 AM






I'm just in the process of developing a web server component and have come
up against one final problem. It's like a data grid in that it displays
rows of data - which can be edited / updated in-line. The edit / update
buttons are child ASP:button controls. I have all the functionality working
as I intended, however whilst the data / screen layout is updated
accordingly when you click a page, the page itself is redisplayed at the top
of the document (so you lose your position in the html page and have to
scroll back down). Is there a way to programmatically update the position
within the page, or do you have to define Href anchor points within your
component and modify the form post location accordingly in the client side
javascript/vbscript that is output by the ASP:button (which i guess would
require me to override / modify the ASP:button as well). Any hints / tips
would be greatly appreciated.

Regards,

- Paul.



Reply With Quote
  #2  
Old   
Steve C. Orr [MVP, MCSD]
 
Posts: n/a

Default Re: Position in Page after a "Submit" - 08-19-2006 , 12:48 AM






In ASP.NET 1.x, if you enable SmartNavigation on the page, it should be able
to retain the scroll position after postback.

Here's more info:
http://msdn.microsoft.com/library/de...ationTopic.asp

If you're using ASP.NET 2.0, there is a (usually) better alternative:
Page.MaintainScrollPositionOnPostBack = True

Here's more info:
http://msdn2.microsoft.com/en-us/lib...ostbac k.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"Paul" <nonone (AT) noone (DOT) com> wrote

Quote:
I'm just in the process of developing a web server component and have come
up against one final problem. It's like a data grid in that it displays
rows of data - which can be edited / updated in-line. The edit / update
buttons are child ASP:button controls. I have all the functionality
working as I intended, however whilst the data / screen layout is updated
accordingly when you click a page, the page itself is redisplayed at the
top of the document (so you lose your position in the html page and have
to scroll back down). Is there a way to programmatically update the
position within the page, or do you have to define Href anchor points
within your component and modify the form post location accordingly in the
client side javascript/vbscript that is output by the ASP:button (which i
guess would require me to override / modify the ASP:button as well). Any
hints / tips would be greatly appreciated.

Regards,

- Paul.




Reply With Quote
  #3  
Old   
Paul
 
Posts: n/a

Default Re: Position in Page after a "Submit" - 08-21-2006 , 03:21 AM



That's great, thanks for the help. Thanks also for not pointing out that
I'd forgotten to add which version of DotNet I was using (it was 2.0).

"Steve C. Orr [MVP, MCSD]" <Steve (AT) Orr (DOT) net> wrote

Quote:
In ASP.NET 1.x, if you enable SmartNavigation on the page, it should be
able
to retain the scroll position after postback.

Here's more info:
http://msdn.microsoft.com/library/de...ationTopic.asp

If you're using ASP.NET 2.0, there is a (usually) better alternative:
Page.MaintainScrollPositionOnPostBack = True

Here's more info:
http://msdn2.microsoft.com/en-us/lib...ostbac k.aspx

--
I hope this helps,
Steve C. Orr, MCSD, MVP
http://SteveOrr.net


"Paul" <nonone (AT) noone (DOT) com> wrote in message
news:%23HDa8CSwGHA.1272 (AT) TK2MSFTNGP05 (DOT) phx.gbl...
I'm just in the process of developing a web server component and have
come up against one final problem. It's like a data grid in that it
displays rows of data - which can be edited / updated in-line. The edit
/ update buttons are child ASP:button controls. I have all the
functionality working as I intended, however whilst the data / screen
layout is updated accordingly when you click a page, the page itself is
redisplayed at the top of the document (so you lose your position in the
html page and have to scroll back down). Is there a way to
programmatically update the position within the page, or do you have to
define Href anchor points within your component and modify the form post
location accordingly in the client side javascript/vbscript that is
output by the ASP:button (which i guess would require me to override /
modify the ASP:button as well). Any hints / tips would be greatly
appreciated.

Regards,

- Paul.






Reply With Quote
Reply




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.