Thursday, March 22, 2012

MaintainScrollPosition in masterpage + ajax

Hello. A little tricky situation:
I have a master page. Inside that master page I have A div (With
overflow:scroll) that contain an ajax updatePanel.
Inside that updatePanel I have a tree.

The problem is That if I scroll down the tree and then select a node.
The tree jump back to the top.

Because I'm inside a masterpage I don't have the
"maintainScrollPositionOnPostBack".

Is there a way to select node with out it jump to the top?

Thanks in advance,
Roy.Its looks like the problem is not in the master page.
I think it have something to do with the ajax and JS.

I added a JS to my DIV that should rememebr the scroll position every
time and update it when the page load.
The problem is that when I select a node in the tree, It doesn't
refresh the page and I think that thats way it doesn't run the JS

Any body know this case?

\On 18 , 09:01, nicknack <roezo...@.gmail.comwrote:

Quote:

Originally Posted by

Hello. A little tricky situation:
I have a master page. Inside that master page I have A div (With
overflow:scroll) that contain an ajax updatePanel.
Inside that updatePanel I have a tree.
>
The problem is That if I scroll down the tree and then select a node.
The tree jump back to the top.
>
Because I'm inside a masterpage I don't have the
"maintainScrollPositionOnPostBack".
>
Is there a way to select node with out it jump to the top?
>
Thanks in advance,
Roy.


javascript included in a div will not fire with an async postback
(updatpanel). you should attach you scroll code to the
PageRequestManagers beginrequest and endrequest events. see ajax doc's.

-- bruce (sqlwork.com)

nicknack wrote:

Quote:

Originally Posted by

Its looks like the problem is not in the master page.
I think it have something to do with the ajax and JS.
>
I added a JS to my DIV that should rememebr the scroll position every
time and update it when the page load.
The problem is that when I select a node in the tree, It doesn't
refresh the page and I think that thats way it doesn't run the JS
>
Any body know this case?
>
>
\On 18 , 09:01, nicknack <roezo...@.gmail.comwrote:

Quote:

Originally Posted by

>Hello. A little tricky situation:
>I have a master page. Inside that master page I have A div (With
>overflow:scroll) that contain an ajax updatePanel.
>Inside that updatePanel I have a tree.
>>
>The problem is That if I scroll down the tree and then select a node.
>The tree jump back to the top.
>>
>Because I'm inside a masterpage I don't have the
>"maintainScrollPositionOnPostBack".
>>
>Is there a way to select node with out it jump to the top?
>>
>Thanks in advance,
>Roy.


>
>

0 comments:

Post a Comment