Keeping Scroll Position over post Backs
page 1 of 3
Published: 20 Jan 2004
Unedited - Community Contributed
Ever got one of those long pages that you wanted to retain the scroll position for that much needed post back? Justin Lovell has worked out an all-browser solution to the problem.
by Justin Lovell
Average Rating: 
Views (Total / Last 10 Days): 42260/ 38


(Update: The StaticScrollBackPosition control has got a few extra "features" added to it. The entire article has been revised to reflect on the changes. )

(Note: You may download the control at the very last page of this article)

When your page does a post-back to the web server, we sometimes need to persist the scroll position where the user was before the post back began. If this sounds like your need for your application, I have developed the server control to solve your problem.

There is a built-in feature (in the .NET Framework) for keeping the scroll position of the user (and also other useful features), called smart navigation. However, this built-in feature posses two problems that my server control (I named it StaticScrollBackPosition) overcomes:

  • Smart navigation can only be used by Internet Explorer 5+. StaticScrollBackPosition caters for majority of browsers:

    • Internet Explorer 4 +

    • Netscape 4 +

    • Opera 7 + (possibly lower versions as well)

    • Mozilla 1 + (possibly lower versions as well)

  • Under smart navigation, the formatting of the pages from post back can go tremendously wrong; if the styling of the page is a mixed breed of CSS and HTML tags.

To use the server control, it is as simple as dropping it in a web form (must be under the server side <form>). However, I am going to explain the few tricks that I used in creating the server control.

The basic idea behind the StaticScrollBackPosition control is that it will not output any user interface – it will only use JavaScript to do all the work for us. The major tricks are:

  1. As the user "views" the page, the scrolled position is constantly recorded to the hidden fields that StaticScrollBackPosition provided.

  2. Back to the server processing, StaticScrollBackPosition will then capture the positions that was placed in the hidden fields and then send a JavaScript block telling the browser where to scroll to once the page has loaded.

  3. And so the cycle will continue from step one after each post-back.

It is that simple. And to make things sound even more simpler, is the fact that the JavaScript has an extremely small size.

View Entire Article

User Comments

Title: test   
Name: test
Date: 2011-01-18 4:26:27 PM
Title: Not working in IE
Name: Ginu Mathai
Date: 3/5/2010 12:24:02 AM
its not working in IE. So I made a small modification.

private const string ScriptGetPositionLine = ScriptHiddenField +
" = (navigator.appName == 'Netscape') ?{1}Offset : ((document.body.parentElement) ? document.body.parentElement.scroll{2} :document.body.scroll{2});";
Title: With Update Panel   
Name: Mr .Shah
Date: 2010-07-28 8:38:29 AM
Is this work where update panel is used ?????
Title: JSP / JAVA   
Name: peeter
Date: 2010-04-07 4:32:35 PM
What are the changes I need to make for making it work in JSP.
Title: Not working in IE   
Name: Ginu Mathai
Date: 2010-03-05 12:24:02 AM
its not working in IE. So I made a small modification.

private const string ScriptGetPositionLine = ScriptHiddenField +
" = (navigator.appName == 'Netscape') ?{1}Offset : ((document.body.parentElement) ? document.body.parentElement.scroll{2} :document.body.scroll{2});";
Title: It works!   
Name: ganck
Date: 2009-11-24 12:15:36 AM
I'm using Visual Studio 2003 and it works for me.
Thank you so much. [24-11-2009]
Title: Software Dev   
Name: Kevin Smith
Date: 2009-08-25 2:08:30 PM
Sweet, finally, just what i was looking for, MS smartnavigation and maintainpositiononpostback were giving me endless javascript issues, you're works perfectly, thankyou!
Title: Didn't work for me   
Name: Chip J
Date: 2009-01-28 9:52:41 AM
Not sure why this control didn't work for me, but MaintainScrollPositionOnPostBack = True did. Thanks for the effort.
Title: Awsome!   
Name: Steve R
Date: 2008-11-06 3:55:38 PM
This is great, I've added it to my arsenal of weapons.
Title: nice job   
Name: nice job
Date: 2008-10-21 8:50:47 AM
simple is the key, nice tool. lol to those saying it doesnt work and pitty would have been nice, you's may need to start w/ an asp primer before implementing custom controls to get the feel for proper implementation
Title: thank   
Name: danai
Date: 2008-10-17 1:03:39 PM
thanks a lot...
Title: quick loans   
Name: quick loans
Date: 2008-10-08 11:03:22 AM
can't get it to work on postback. works fine if i just set the scroll value myself.
Title: nice article   
Name: nn
Date: 2008-06-27 12:46:36 AM
well done and very useful code...
thanks a lot...
Title: great yar , great   
Name: rajiv
Date: 2008-05-08 6:42:01 AM
keep it up
Title: great!   
Name: uj
Date: 2008-04-29 6:02:10 PM
thanks a lot! usage is simple and it works great!!
Title: Doesn't Work   
Name: Sean
Date: 2007-10-29 1:32:42 PM
It's unfortunate, this doesn't work at all. Just does nothing. Would have been nice.
Title: Requirements   
Name: Patrice
Date: 2007-09-02 2:48:49 PM
Can anyone tell me, please, if this requires sharepoint services? I'm getting a "resource cannot be found" error.

Thank you!
Title: Wow!   
Name: Chris
Date: 2007-08-29 12:39:48 AM
I used this control on my personal website. It works great. Not to mention it was easy to setup. It takes a true programmer to come up with such a tool. I hope I can learn how to do that someday.
Title: You are the man   
Name: Manoochehr
Date: 2007-08-08 4:48:42 AM
Hey thanks . I was mixed up with this issue but you solved it easily . you are the man . I like you
Title: MaintainScrollPositionOnPostBack   
Name: GD
Date: 2007-07-26 8:33:10 AM
MaintainScrollPositionOnPostBack = True

does everythign the convoluted javascript alternatives do!
Title: Mr.   
Name: Faraz
Date: 2007-05-24 8:29:33 AM
It's not working if the button is inside usercontrol(ascx) neither does MaintainScrollPositionOnPostback. any idea?
Title: Works like a charm   
Name: Kirit Raja
Date: 2007-05-22 10:33:02 AM
It works like a charm. It resolved my long standing issue. Thanks a lot.
Title: Thanks   
Name: Juan Francisco (
Date: 2007-03-30 5:10:55 PM
Tahnks a lot for your code.

If I can help you in anything, please contact me

Best Regards
Title: thanks   
Name: sam
Date: 2007-03-29 2:14:04 AM
i like this artical
Title: PHP apache   
Name: Nico van de Kamp
Date: 2007-02-02 5:37:26 AM
I don't understand it completely but I need de server control's binary? But I saw there are DLL's in it. So is this solution only available for IIServer?

By the way I have some input fields on the document and then a long record list set, positioned with a div. Somebody can choose a record by double clicking on it. After double clicking on a record the document is submitted to the server.

Can someone help me?

Thanks in advance?
Title: SmartNavigation without your Control !!!!!!   
Name: Abdulla Hussein
Date: 2007-01-29 3:30:30 AM
Hi , There is a line code that can do the smartNavigation without using your serverControl
just write the following code in the page_Load

Me.MaintainScrollPositionOnPostBack = True

Please if you see this reply tell me if my code does not work in some diffrent browsers :-)
Title: This is the Greatest!!!!   
Name: Tuong Do
Date: 2006-12-27 11:55:47 AM
This is a great control that works perfectly!!! I spent hours looking something that would work!!
Title: Worthless   
Name: Josh
Date: 2006-12-22 12:26:16 PM
This doesnt work. Do not waste your time, becuase this guy has a function called on the Onload of the window that sets scroll to 0,0 every time. This is worthless!
Title: Thanks   
Name: Ananya
Date: 2006-12-14 3:55:36 AM
Thanks a ton for providing solution.
Title: is it coz i m using asp 2..0   
Name: aman
Date: 2006-11-10 8:22:04 AM
referring to the above comment is it coz I am doing that in asp 2.0

is there a simpler way to do it in asp .net 2.0
Title: does not work in IE   
Name: aman
Date: 2006-11-10 8:15:19 AM
I got the code working

I have put it in the master page of my project

I copied the dll from therelease folder

problem is

it works with firefox
but doesn't work with IE

can you please tell me the solution
Title: Thanks a lot !   
Name: Cyrille
Date: 2006-10-30 7:45:49 AM
It's simple and efficient... I needed to make editable a huge table and it work perfectly...

Title: Keeping Scroll Position over post Backs   
Name: Ted Green
Date: 2006-10-17 11:39:42 AM
It Works! simple and sweet! Thanks very much.
Title: Awesome   
Name: Chad
Date: 2006-09-25 5:08:11 PM
Thanks a million. I was pulling my hair out trying to fix the postback issue. This fixed it.
Title: Re: Problems with master pages in ASP.NET 2.0   
Name: Tomasz Saluszewski
Date: 2006-09-11 10:23:51 AM
I've slightly modified the control described in and it worked (both IE and Safari)!
The only thing I had to do to overcome 'master pages' problem was to chamge the way aspnet form is located in javascript. Here is the code:
var aspForm = document.forms['aspnetForm'];
if (!aspForm) {
aspForm = document.aspnetForm;
Title: Problems with master pages in ASP.NET 2.0   
Name: Tomasz Saluszewski
Date: 2006-09-01 3:42:34 AM
I am having a problem using Your control in my ASP.NET 2.0 web pages. I suspect it's due I am using master pages. I've tried placing the control in both master and content page, but neither worked. Any ideas?

I cannot use ASP.NET 2.0 MaintainScrollPosition page attribute as it doesn't work in Safari, which I need to support.
Title: Great Stuff   
Name: David Ross
Date: 2006-08-31 7:25:28 AM
Absolutely Superb. Well done

It worked like a dream and only two lines of code for me!
Title: Thank you very much for your help   
Name: Fedor
Date: 2006-08-22 7:22:49 AM
Thank you for solving this annoying problem of losing scroll position at postback. This gives me a lot more freedom of choosing a long data entry form instead of having to cut it up, divide it over several webforms, or hide portions of it...

Thanks again!
Title: Thanks   
Name: Amit
Date: 2006-08-14 8:05:02 AM
Thanks...My problem has been solved.
May you live long.
Title: Developer community inc   
Name: Kumar
Date: 2006-08-04 7:24:49 AM
Ya it is working fine we sorted out problem with scrolling is fixed after postback.thanks
Title: .Net 2.0   
Name: Giovanni
Date: 2006-08-02 3:33:03 PM
Does your control work in with 2.0?
Title: Please Interpret   
Name: John Cahill
Date: 2006-08-01 10:30:59 PM
Hi, Justin,

The thing you built sounds just what I need but I don't know a lot about this, so, if you wouldn't mind:

What, exactly, does this mean, "Drop the compiled assembly into your bin folder and you are set to go." What is the "compiled assembly"? Is it a file? I could guess it is the 'StaticPostBackPosition.dll' file but ... that would be a guess. I don't know what a compiled assembly is so please explain? "Bin" folder? Firstly, what machine ... the web server? "Bin" folder ... I have searched my computer and there are 19 Bin folders. Which one should I put the "compiled assembly" in?

Thanks, in anticipation, for your clarification.

Title: Good Job   
Name: Dan
Date: 2006-07-24 5:29:51 PM
Works great! Thanks!
Title: Tweak   
Name: Adam
Date: 2006-07-12 3:46:32 PM
To get this to work in IE 6, I had to change document.body to document.documentElement
Title: Javascript error   
Name: Bala
Date: 2006-07-11 9:11:17 PM
It works fine...
When I use javascript calendar control, after postback i get javascript error and calendar control is not getting loaded
Title: Thanks   
Name: Manny
Date: 2006-07-11 1:11:52 PM
Thanks so much! Its working great.
Any suggestions for retaining the scroll position in a div tag.

Title: great   
Name: adam
Date: 2006-07-06 5:57:04 AM
worked first time, job well done
Title: Thanks   
Name: Gary
Date: 2006-06-30 2:37:42 PM

THANKS! This made my job so easy.
Title: astonishingly simple   
Name: Arun N Mahendrakar
Date: 2006-06-29 12:30:09 PM
dudeee.. this was too easy dudeee

Thanks dudeee
Title: Sytem Analysist   
Name: Fed Derring
Date: 2006-06-27 10:40:26 AM
I too am getting the errror

"document.forms.0.StaticPostBackScrollVerticalPosition is null or not an object" even though i have it in a server form.
I tried this(as suggested by Tim Mackey

document.serverForm and made sure that all my server forms had ID=serverForm.
It still fails. Is there any other hints you can provide to solve this?
Thanks - fed
Title: adding this control   
Name: HELP
Date: 2006-06-16 12:31:25 AM
Can you please clarify exactly how to add this control to my project?
Title: Thanks..You are Genius   
Name: Mithilesh Deshpande
Date: 2006-06-15 5:59:53 PM
Hi Justin,

Thanks a lot...your code is your name.

This really helped in our project, we use a Calendar control, which uses IFRAME and with SmartNavigation, it was not getting rendered on Postback.

Bye bye to SmartNavigation and Welcome to StaticPostBackPosition


Title: Scroll position   
Name: Debojyoti Bose
Date: 2006-05-24 1:28:25 AM
Good article.We faced the problem of scroll positioning in JSP.We added the code snippet and that works.
Title: Muy Bueno   
Name: Val
Date: 2006-05-14 7:38:19 PM
Este pequeño .dll es fantástico, es lo que andaba buscando, graciass.
Title: Scrolls Works with Div and page scroll   
Date: 2006-04-06 10:23:44 AM
I have a control like this, BUT my control works with Div and preserve the page scroll...

send me a email and i will send my controls for free.. (VB.NET)
Title: I have a control   
Name: I have a control
Date: 2006-03-11 12:27:06 PM
I have a control like this, buy my controls works with Div and preserve the page scroll...

send me a email
Title: Thanks   
Name: Chris
Date: 2006-03-09 2:13:13 AM
It works. Great!
Title: This could save the world   
Name: Osama
Date: 2006-03-08 8:06:53 PM
This is great. I ported it over to VB and I was in business. Very simple and works well.
Title: Works PERFECTLY!   
Name: Jeremy Reid
Date: 2006-03-06 3:42:22 PM
Thanks so much man, it works perfectly. This was exactly what I was looking for. You just saved me so much time!

Thaks again.
Title: Thanx a lot   
Name: Ravi Khatri
Date: 2006-02-22 12:47:51 AM
Thanx a lot JUSTIN. Simply great job
Title: What about Div element (or panel for that matter)   
Name: Felipe B.
Date: 2006-02-16 6:53:41 AM
Is It possible to do the same with Div elements or Panels?
I usually use Div with autoscroll and inside it some datagrid with a select button, so when It's clicked It does a PostBack loosing the original position in the Div or panel.
Title: You are the Man!   
Name: Lee
Date: 2006-02-08 5:55:05 PM
Your control is bad to the bone. Just what I've been trying to accomplish. It works so well I honestly didn't think the page was even posting back. Thanks for your time and effort and making this great control available to the development community.
Title: I'm Impressed   
Name: Pablo Ganga
Date: 2006-02-07 7:33:15 AM
I'm impressed this control is awesome
Title: Wow   
Name: Joel
Date: 2006-01-26 9:11:16 PM
That is amazing. Installing it was way easier than I tried to make it. a person just needs to literally drop the dll file into the bin directory and then add the control to the page. WOW!!!!!
Title: Machi Super Machi - Thanks Machi.   
Name: Govind
Date: 2006-01-06 8:00:07 AM
Its really wonderful, Now you have made an improvement over smartnavigation that having some flaw like CSS has been disappeared. now this looks simple and GREAT!!
Title: Thanks from Justin to Justin   
Name: Justin
Date: 2005-11-28 6:19:17 PM
Thanks a lot for your control,

Its very easy to use.

Title: Thank!   
Name: bull_evil
Date: 2005-11-10 11:54:48 AM
excelent in all the web said use the dam smart...Navi..shit..really thank a lot work very fine.
All you have to do it download the inside you will find StaticPostBackPosition.dll extract to somewhere then in the tool box panel...secundary mouse click then add..remove items then you have to search the somewhere path (extract path or look for dll) will see a new tool icon "StaticPostBackPosition", thats it you only have to drag and drop the new do the work.
Title: Thanks!   
Name: Marc
Date: 2005-11-02 7:32:01 AM
My javascript menu's would not work on postback with smartnavigation.

This totally solved the problem for me - Thanks!
Title: MaintainScrollPositionOnPostback   
Name: SC
Date: 2005-10-26 4:17:22 PM
ASP.NET 2.0 has a property called MaintainScrollPositionOnPostBack. Works nice.
Title: available for jsp?   
Name: smurfy
Date: 2005-10-18 3:50:17 AM
does anyone know if this cool thing is also available for jsp?
Title: DBA/Developer   
Name: Yen Yeoh
Date: 2005-10-16 9:11:18 PM
Many Thanks Justin. It's working well!
Title: Thanks   
Name: IndianaJonas
Date: 2005-10-14 1:52:07 AM
Thanks Thanks Thanks
Title: Is It Suppose To Work Like This ?   
Name: Raf
Date: 2005-09-30 3:14:10 PM
hey, the thing is awesom, really saves trouble, but when i used it in my asp pages, on eveypostback it jerks to the top and then comes to the scroll position. Is it suppose to be like that or is it because of any other reason?
Title: Thanks a Lot   
Name: Bhargav Joshi
Date: 2005-09-29 12:26:36 PM
Thank you solved an irritating problem for me!
Title: Very nice   
Name: Reynold Tucan
Date: 2005-09-22 6:38:10 PM
Very nice and easy to use solution. Solved the problem that SmartNavigation caused (disappearing javascript menu on postback). Awesome and thanks.
Title: Brill, neat and simple   
Name: Zoli
Date: 2005-08-07 10:10:10 AM
Thanks Justin, I've had so many problems with that dreadful SmartNavigation and now thanks to you, there is no need to use it anymore.
Your solution works like dream.
Thanks again.
Title: Keeping Scroll Position over post Backs   
Name: xyv
Date: 2005-08-04 2:33:17 AM
The Control is not working with Mozilla.
Title: smart navigation   
Name: pips
Date: 2005-07-27 7:28:17 AM
Thank you so much. Smart nav worked on our dev machine but caused all sorts of technical problems when deploying to live! I needed a quick fix and you saved me having to write the control myself! You're a star and very generous sharing your work!!

Title: not working in firefox   
Name: santhosh thomas
Date: 2005-07-25 11:12:53 AM
hi, thanks for the code, its working in IE. But its failing in firefox (1.0.4)
Title: Greate Control   
Name: GWH
Date: 2005-07-20 5:15:32 PM
Great control Jorge Arturo Aviles Nuñez; It works great.
Title: GREAT   
Name: Eric Kwerreveld
Date: 2005-07-01 10:03:09 AM
Great control!!! Thanks a lot, just what i needed.
Title: Brilliant   
Name: Graeme
Date: 2005-06-21 5:23:14 PM
That is the quickest easiest thing I have ever had to do. It works a treat and I have placed it into all my applications.

Thanks you for the control!!! You are brilliant!!!
Title: Thanks!   
Name: Abdulla
Date: 2005-06-04 1:52:54 PM
Thank you a lot for your control....
Title: You are fantatic   
Name: Kent
Date: 2005-04-22 12:29:16 AM
The control is great... Thank to post this control
Title: Awesome!   
Name: Awesome!
Date: 2005-04-06 10:09:13 AM
Title: Thanks   
Name: D
Date: 2005-03-16 6:29:50 PM
Thanks a lot, it save me headache and time. Also a great sample for a newbe.
Title: Good one   
Name: Rajesh
Date: 2005-03-05 6:40:20 AM
This is a good control and very easy to install. Thank you very much
Title: Please Help!!!   
Name: Victoria
Date: 2005-03-03 3:31:49 PM
I'm getting the following error:

"JIT Debugging component registration is incorrect."

Do you think you can help???
Title: Getting that is null or not an object error   
Name: ewd
Date: 2005-03-01 3:05:36 PM

I'm getting this error when the project is copied to the test server:
"document.forms.0.StaticPostBackScrollVerticalPosition is null or not an object"

On my laptop is works as advertised. However in Visual Studio I get an error in the Design portion of the IDE for the form. In the upper left part of the screen it says "Error Creating Control - Staticpostbackposition1" and the info button says "Parse error: Unknown server tag jlc:Staticpostbackposition" I think it's having problems with the <@ Register... however I copied exactly what's on the page here. Anyone else seen this and no what bone head manuever I'm performing to get this? Other than that this is a great replacement for SmartNavigation!


Title: Oux   
Name: Smbie
Date: 2005-02-17 9:08:43 PM
Stream, the control works great!

Title: what about IE?   
Name: David Lee
Date: 2005-02-16 7:14:46 PM
did i miss something? or.. does this assume SmartNav is still on for IE?

I have a server form, tag is inside form.. and it doesn't work in IE. (haven't tried FireFox yet)
Title: Stream   
Name: Jorge Arturo Aviles Nuñez
Date: 2005-02-16 3:47:50 AM
Example of my Control:
Protected WithEvents CtrlPreserveScrolls1 As CtrlPreserveScrolls

Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Not IsPostBack Then
CtrlPreserveScrolls1.Add( CtrlPreserveScrolls.TypeControl.DIV, "DivUsuarios")
CtrlPreserveScrolls1.Add( CtrlPreserveScrolls.TypeControl.DIV, "DivMaestros")
CtrlPreserveScrolls1.Add( CtrlPreserveScrolls.TypeControl.DIV, "DivAgentes")
CtrlPreserveScrolls1.Add( CtrlPreserveScrolls.TypeControl.THEWINDOW)
End If
End Sub
Title: Stream   
Name: Jorge Arturo Aviles Nuñez
Date: 2005-02-16 3:33:09 AM
Hello, I have modified the code source, and I have created "webControl" able to keep the position from any DIV and scroll of the page.

Hola, he modificado el codigo fuente, Y he creado un "webControl" capaz de guardar la posicion de cualquier DIV y el scroll de la pagina.

You can see it from here:

And can be downloaded here:

Thanks rookK by the link, gracias viejo :D

Title: So close...   
Name: Kevin
Date: 2005-02-11 9:57:40 AM
This is exactly what I have been searching for. I'd be thrilled if I could just get it to work.

Any idea why this would work in mozila but not IE? IE isn't throwing an error but it's not working either.
Title: Why scrolls always jumps to 400?   
Name: Uros
Date: 2005-02-07 8:36:02 AM

I have the same questions like Terry... I copy/pasted the code to the page, but now scrolls always jumps to 400, so I don't get this function:

function RestoreScrollPosition()
scrollTo(0, 400);

It should jump to previous state (before postback)?
Title: Thanks   
Name: L.D.
Date: 2005-01-11 2:39:25 PM
Wonderful! All formatting and scroll positions are preserved (they were was lost with SmartNavigation). Thanks a lot!
Title: asp.NET developper (MCAD)   
Name: Simon Jarry
Date: 2004-12-23 12:30:12 AM
Thanks a lot ! I really appreciate this control I have been installing on every of my projects now ! this is the final solution.. forget SmartNavigation !!!
Title: tip for null error   
Name: Tim Mackey
Date: 2004-11-23 6:02:24 AM
i also got the error:
"document.forms.0.StaticPostBackScrollVerticalPosition is null or not an object" even though i had it in a server form. the problem was that i had some html forms before the server form, and obviously then the hard coded document.forms[0] was referring to the wrong one. i changed this code reference to: document.serverForm and made sure that all my server forms had ID=serverForm.
this is a great control. thanks for making it freely available.
Title: Sapient Corporation   
Name: Jassi
Date: 2004-11-22 12:39:04 PM
Thanks.... this is a real cool stuff...
Title: Fantastico   
Name: Gift
Date: 2004-11-02 5:35:25 AM
Thatz gr8, thankx a lot
Title: Developer   
Name: Moojjoo
Date: 2004-10-27 2:55:22 PM
How do I get this control to show up in my toolbox?
Title: Happy Bunny   
Name: Norry Passway
Date: 2004-10-27 6:20:02 AM
Great! Amazing to think that it wasn't a feature of ASP.NET. Works a treat and I am a happy bunny. Thanks for posting this solution.
Title: Finally, a scroll-position script that works!   
Name: Todd Taylor
Date: 2004-10-26 2:11:39 PM
Thanks for posting this solution, Justin. I tried multiple other solutions to the scroll-position problem, but all the other solutions seemed to either create new problems or they just didn't work with my web pages dynamic panels. You solution seems to work perfectly :)
Title: Cool Control   
Name: Saharul Nizam Saaidi
Date: 2004-10-20 9:01:00 PM
I would like to thank you for creating this control. I think it is a cool control. It is simple control, but to me it is very useful.

Thanks a lot.
Title: Damn good   
Name: chaminda jayakody
Date: 2004-10-13 2:26:49 PM
i love u man,
Title: Mr   
Name: Doug Stowell
Date: 2004-10-05 9:34:21 AM
Really helpful - got me out of a potential showstopper!!! Thanks.
Title: thanks a lot   
Name: Frances
Date: 2004-09-30 6:57:33 AM
You made me a very happy person!
Title: Thanks!!   
Name: Yeiouaryii
Date: 2004-09-29 3:36:32 AM
Thank you very much.
Title: RestoreScrollPosition?????   
Name: Terri
Date: 2004-09-23 8:27:05 PM
Maybe I'm missing something but when I put this in my code it always scrolls to 400 (or whatever the last number is). I see the comment says determined during runtime but don't see how since the numbers are hard coded.

function RestoreScrollPosition() { scrollTo(0, 400); // determined during run-time}
Title: Re: Client Script Errors   
Name: Justin Lovell
Date: 2004-09-22 1:06:26 PM
Hi guys,

I bet you that most of the problems is caused under the following scenerios:

* You don't have a server-side form.
* The control was not dropped in a server side form.

To resolve the problem, do the converse (opposite) of the things that you are doing wrong where it applies.

Title: StaticPostBackScrollVerticalPosition   
Name: Stuart
Date: 2004-09-22 12:23:17 PM

I am also getting a client side script error with the message that "document.forms.0.StaticPostBackScro
llVerticalPosition is null or not an object"

Title: "RE:Looks like Stanley Glass's code?" and "RE: Works like a charm for me so far"   
Name: Justin Lovell
Date: 2004-09-19 3:40:08 AM
Luu and Stan,

I have blogged a response to both of your comments over here:
Title: Works like a charm for me so far   
Name: Luu
Date: 2004-09-17 8:18:36 PM
This will save a lot of people frustration using smart navigation. This is what you would expect from the development community and shows we are all out to solve the same problems. I hope Microsoft solves this problem with ASP.NET 2.0?

Thanks, Justin
Title: Thanks   
Name: Joe
Date: 2004-09-14 6:35:09 PM
Thank you very much for this control, there's only one bug when I use a DataGrid + nested ASP Repeater, the problem is because I use a CheckBox to display the Nested ASP Repeater so with your control it doesn't scrolls down well because it only counts the pixels (rows) the first time the page is loaded so when it is refreshed it doesn't returns to your exact position.
Title: StaticPostBackScrollVerticalPosition   
Name: Rahul
Date: 2004-09-14 3:33:49 AM
hey Justin,

we are getting a client side script error with the message that "document.forms.0.StaticPostBackScrollVerticalPosition is null or not an object"

Any help would be much appreciated.

Title: Re: Only works on refresh not postback   
Name: Justin Lovell
Date: 2004-09-11 1:10:18 PM

You are required to have a server side form for the JavaScripts to register. Please check this.

Title: Only works on refresh not postback   
Name: Don
Date: 2004-09-11 8:27:35 AM
After being frustrated with SmartNavigation I tried this control and found that it only works on a forced refresh not on a postback. This is similar yet a different condition than Lou posted. Is there any code I need to write in the Page_Load?
Title: Woo Hoo   
Name: Ahmed
Date: 2004-09-06 4:59:42 AM
Justin Lovell is the coolest guy ever. I appreciate you sharing the knowledge. Take it easy...
Title: Many Thanks   
Name: Bill Potter
Date: 2004-09-01 8:49:18 AM
Many thanks this was exactly what I was looking for.
It has solved various problems I have had with various sites
Title: Excellent solution   
Name: DanielG
Date: 2004-08-23 6:44:58 PM
This is just wath I need. Works great!!!
Title: Work great with my templated site   
Name: Scott
Date: 2004-08-20 7:25:36 PM
Could you add IE to the script? or is it just best to use smartnavigation?

Cheers, saved me a huge headache. :-)
Title: Groooooovy!   
Name: Tammy
Date: 2004-08-19 10:30:14 AM
A perfect solution! It rocks! No more smartnavigation!
Title: Thanks   
Name: Eric
Date: 2004-08-03 12:46:09 AM
Comment: works great...beside improve the CSS problem, it also allow the ASP.NET popup a new child window with focus..
Title: Works great -but   
Name: Lou
Date: 2004-07-26 11:22:10 PM
This does a great job of maintaining scroll position during postbacks but it causes my javascript menu bar to disappear from the screen until I do a clean reload of the page. Therefore I sadly cannot use it in my application. Anyone know a possible workaround?

Title: ??!!   
Name: Elaine
Date: 2004-07-13 11:50:37 AM
I am getting the following error when I try to use this control:

"document.forms.0.StaticPostBackScrollVerticalPosition is null or not an object"

Any help would be much appreciated.

Title: Very Good.   
Name: Gopi
Date: 2004-07-05 7:22:52 AM
Thanks!!. The Controls works fine. It is appeciated if the control also get the focus() of the last postbacked control.
Title: President Hallandales Inc.   
Name: Gary Eisert
Date: 2004-07-01 6:05:57 PM
Thanks a million for your time and the expense of putting these solutions on the Internet for developers to solve these kinds of problems.

Works just fine!! 86 SmartNavigation....
Title: Thanks!   
Name: Christy
Date: 2004-06-26 1:42:40 PM
Thanks so much! I was having a problem with the SmartNavigation in that I had a Calendar control that is called from a pulldown menu. The SmartNavigation always gave the main page the focus, which would hide the calendar page. Your application solved this - thanks!


Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-07-23 1:50:51 PM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search