<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://forums.asp.net/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>ASP.NET AJAX UI</title><link>http://forums.asp.net/1008.aspx</link><description>Here you can discuss UI-related issues with AJAX such as controls and client-side functionality including Silverlight controls for ASP.NET</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP1 (Build: 20510.895)</generator><item><title>Re: Maintain scroll position of a DIV over a callback</title><link>http://forums.asp.net/thread/2453701.aspx</link><pubDate>Sat, 28 Jun 2008 04:23:12 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:2453701</guid><dc:creator>lenobay</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/2453701.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=2453701</wfw:commentRss><description>&lt;p&gt;&amp;nbsp;It works great with MasterPage that has contentpages.&lt;/p&gt;&lt;p&gt;HOWEVER, once there is a TabContainer, it doesnt seem to work as GOOD.&lt;/p&gt;&lt;p&gt;The scroll Position is quite off, it jumps up quite bit with a TabContainer .&lt;/p&gt;&lt;p&gt;I read posts that i should put a hidden control to save and restore scrollTop, but i have no idea what to do?&lt;/p&gt;&lt;p&gt;anyone? &lt;br /&gt;&lt;/p&gt;</description></item><item><title>Re: Maintain scroll position of a DIV over a callback</title><link>http://forums.asp.net/thread/1683284.aspx</link><pubDate>Thu, 26 Apr 2007 11:19:37 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1683284</guid><dc:creator>Hoonius</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1683284.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1683284</wfw:commentRss><description>&lt;p&gt;Hi Aaron&lt;/p&gt;
&lt;p&gt;To my knowledge, there is no solution to the 20 cookie limit as this is enforced by the browser.&amp;nbsp; As soon as the 21st cookie is entered, it just removed the first one in the list resulting in a list of 20 cookies.&lt;/p&gt;
&lt;p&gt;The collection itself seems to self delimit.&amp;nbsp; I just add divTimzDiv=200 and it delimits with a semi-colon.&amp;nbsp; The code &lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;document.cookie = "divTimzDiv=200";&lt;/p&gt;
&lt;p&gt;document.cookie = "divTimzOtherDiv=200";&lt;/p&gt;
&lt;p&gt;Would result in "ASPNETSESSION=kjlhnhjk-987978njm9jhnhnknj;divTimzDiv=200;divTimzOtherDiv=200;"&amp;nbsp; inside the cookie collection.&amp;nbsp; The only thing you msut be wary of is losing that first cookie as it contains the SessionID so your app can "remember" who is calling it in realtion to a previous request.&lt;/p&gt;
&lt;p&gt;Not bulletproof by any means. Did you get the dragPanels to save their position?&amp;nbsp; You could add hidden fields I suppose but i imagine you'd need to store the ID's as they are created so you could iterate through them later or just have one to store all the postions in a delimited fdashion and interogate this string on pageLoad() maybe.&amp;nbsp; You can attach to all the different events of the PageRequestManager, help is &lt;a href="http://ajax.asp.net/docs/overview/PageRequestManagerOverview.aspx" target="_blank"&gt;here&lt;/a&gt; if you need any info in the object&lt;br /&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Maintain scroll position of a DIV over a callback</title><link>http://forums.asp.net/thread/1675448.aspx</link><pubDate>Fri, 20 Apr 2007 20:19:56 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1675448</guid><dc:creator>Aaron Edwards</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1675448.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1675448</wfw:commentRss><description>&lt;p&gt;I think you could also use this technique to "remember" where a dragPanel is between callbacks.&amp;nbsp; Currently, if you've got an open dialog box, for example, or anything that the user can drag around, it will jump back to it's original position with every call back.&amp;nbsp; I understand that you can implement profiling for remember position, but no one seems to know first hand how this works, and it also seems like a bit of overkill for just remembering position between call backs (I think the profiling solution is more for remembering all of a user's preferences between visits to the website).&lt;/p&gt;
&lt;p&gt;I'm going to play around with it and see what I can come up with.&amp;nbsp; Your solution got past the 20 cookie limit, right?&amp;nbsp; Are you using one cookie for everything, delimited with some character?&amp;nbsp; I guess you could also use hidden fields.&lt;/p&gt;
&lt;p&gt;Aaron&lt;/p&gt;</description></item><item><title>Re: Maintain scroll position of a DIV over a callback</title><link>http://forums.asp.net/thread/1662330.aspx</link><pubDate>Thu, 12 Apr 2007 08:15:42 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1662330</guid><dc:creator>Hoonius</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1662330.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1662330</wfw:commentRss><description>&lt;p&gt;I'm glad you find it useful.&amp;nbsp; I did&amp;nbsp;post in the thread you started as well and i did link this thread in it, not to you admittedly, but to klgrube who was getting rather irate with the whole situation.&amp;nbsp; I never got a reply from her so i guess she took a break from trying to solve it&lt;/p&gt;
&lt;p&gt;The points thing is slightly flawed in this instance becasue i kind of answered my own thread so can no longer be awarded any points for the solution, but not to worry.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I'm just pleased you found it useful as well because the whole thing was doing my head right in, to put it mildly :¬)&lt;/p&gt;
&lt;p&gt;cheers&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Maintain scroll position of a DIV over a callback</title><link>http://forums.asp.net/thread/1662013.aspx</link><pubDate>Thu, 12 Apr 2007 03:05:24 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1662013</guid><dc:creator>Aaron Edwards</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1662013.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1662013</wfw:commentRss><description>&lt;p&gt;Man, Tim, you are a genius.&amp;nbsp; I had all but given up on this.&amp;nbsp; Then I came back months later (I posted a thread on this back in January), looked up the thread, followed a link&amp;nbsp;and there is the answer, in the form of a slick little javascript function provided by you.&lt;/p&gt;
&lt;p&gt;I modified it slightly, to only look for the one div that is causing me grief (most of us don't have 100 scrolling divs on one page, by the way).&amp;nbsp; Other than that it's the same as your first post.&amp;nbsp; I didn't adopt the second one, because the first works just fine for me.&lt;/p&gt;
&lt;p&gt;Thanks again, man.&amp;nbsp; You really made my day.&lt;/p&gt;
&lt;p&gt;BTW did I understand correctly that we can give each other kudos or points or something on this forum?&amp;nbsp; How would I go about doing that.&amp;nbsp; You should get 10000.&lt;/p&gt;
&lt;p&gt;Aaron&lt;/p&gt;</description></item><item><title>Re: Maintain scroll position of a DIV over a callback</title><link>http://forums.asp.net/thread/1586360.aspx</link><pubDate>Tue, 20 Feb 2007 11:56:13 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1586360</guid><dc:creator>Hoonius</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1586360.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1586360</wfw:commentRss><description>&lt;p&gt;the trick is that you need to attach the css class to the header CELLS rather than the header ROW&lt;/p&gt;&lt;p&gt;this.parentNode.parentNode.parentNode.scrollTop-1&lt;/p&gt;&lt;p&gt;translates to &lt;/p&gt;&lt;p&gt;HeaderCell.HeaderRow.Table.Div.scrollTop - 1&lt;br /&gt;&lt;/p&gt;&lt;p&gt;So, on your Gridview.RowCreated Event do this:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;&lt;span class="kwd"&gt;protected void&lt;/span&gt; KarensGrid_RowCreated(&lt;span class="kwd"&gt;object&lt;/span&gt; sender, GridViewRowEventArgs e)&lt;br /&gt;&lt;b id="2"&gt;2    &lt;/b&gt;{&lt;br /&gt;&lt;b id="3"&gt;3    &lt;/b&gt;	&lt;span class="kwd"&gt;switch&lt;/span&gt; (e.Row.RowType)&lt;br /&gt;&lt;b id="4"&gt;4    &lt;/b&gt;	{&lt;br /&gt;&lt;b id="5"&gt;5    &lt;/b&gt;		&lt;span class="kwd"&gt;case&lt;/span&gt; DataControlRowType.Header:&lt;br /&gt;&lt;b id="6"&gt;6    &lt;/b&gt;			&lt;span class="cmt"&gt;//add the css sttribute for all the cells&lt;/span&gt;
&lt;b id="7"&gt;7    &lt;/b&gt;			&lt;span class="kwd"&gt;for&lt;/span&gt; (&lt;span class="kwd"&gt;int&lt;/span&gt; i = 0; i &amp;lt; e.Row.Cells.Count; i++)&lt;br /&gt;&lt;b id="8"&gt;8    &lt;/b&gt;			{&lt;br /&gt;&lt;b id="9"&gt;9    &lt;/b&gt;				e.Row.Cells[i].Attributes.Add(&lt;span class="st"&gt;"class"&lt;/span&gt;, &lt;span class="st"&gt;"FixedTableHeaderCell"&lt;/span&gt;);&lt;br /&gt;&lt;b id="10"&gt;10   &lt;/b&gt;			}&lt;br /&gt;&lt;b id="11"&gt;11   &lt;/b&gt;			&lt;span class="kwd"&gt;break&lt;/span&gt;;       &lt;br /&gt;&lt;b id="12"&gt;12   &lt;/b&gt;        }&lt;br /&gt;&lt;b id="13"&gt;13   &lt;/b&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;pre class="coloredcode"&gt;And that CSS will also need to change to reflect the &lt;span class="st"&gt;FixedTableHeaderCell class so this would be the change&lt;/span&gt;&lt;/pre&gt;&lt;pre class="coloredcode"&gt;&lt;span class="sel"&gt;FixedTableHeaderCell&lt;/span&gt;
{
   border-width:&lt;span class="val"&gt; &lt;span class="unit"&gt;4&lt;/span&gt;px&lt;/span&gt;;&lt;br /&gt;   border-color:&lt;span class="val"&gt; Black&lt;/span&gt;;&lt;br /&gt;   background-color:&lt;span class="val"&gt; Gray&lt;/span&gt;;&lt;br /&gt;   position:&lt;span class="val"&gt; relative&lt;/span&gt;;&lt;br /&gt;   top:&lt;span class="val"&gt; expression(this.parentNode.parentNode.&lt;br /&gt;                   parentNode.scrollTop-&lt;span class="unit"&gt;1&lt;/span&gt;)&lt;/span&gt;;&lt;br /&gt;}&lt;/pre&gt;&lt;pre class="coloredcode"&gt;"table th" is too generic for me as i sometimes want a table to scroll entirely and setting this cause ALL my tables to have fixed headers&lt;/pre&gt;&lt;pre class="coloredcode"&gt;&lt;pre class="coloredcode"&gt;I do have this working my end but the div scroll position is being saved using my JavaScript method, not by enclosing it as stmarti does in that other post you replied to&lt;/pre&gt;&lt;pre class="coloredcode"&gt;Please let me know how you get on and i'll try and fix the footers in the meantime :¬)&lt;/pre&gt;&lt;pre class="coloredcode"&gt;cheers&lt;/pre&gt;&lt;pre class="coloredcode"&gt;Tim&amp;nbsp;&lt;/pre&gt;&lt;/pre&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Maintain scroll position of a DIV over a callback</title><link>http://forums.asp.net/thread/1585710.aspx</link><pubDate>Mon, 19 Feb 2007 23:03:09 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1585710</guid><dc:creator>klgrube</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1585710.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1585710</wfw:commentRss><description>&lt;p&gt;Please&amp;nbsp;help!!&amp;nbsp; I'm&amp;nbsp;getting really desperate here, and actually more than a little upset.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;ALL I WANT TO DO (she screams)&amp;nbsp;. . . . .&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Is have gridview with a fixed header where everything below the header scrolls.&amp;nbsp; I know how to do that using a panel per Paul Kimmel's article&amp;nbsp; at &lt;a href="http://www.developer.com/net/asp/article.php/3585911"&gt;http://www.developer.com/net/asp/article.php/3585911&lt;/a&gt;.&amp;nbsp;&amp;nbsp; This works fine as long as you don't have an edit button on the gridview.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; BUT I want the header to stay where it is and the scroll position of the rest of the gridview to NOT change its place when a user hits the 'Edit' button!!!&amp;nbsp;&amp;nbsp; Is that too much to ask?&amp;nbsp; Gee . .&amp;nbsp;&amp;nbsp; a fixed header gridview that DOESN'T lose the scroll position of the selected or edited row.&amp;nbsp; What a concept.&amp;nbsp; I've found references to each of these ideas separately, but never found a combined solution.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; How do I accomplish that?&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&amp;nbsp; So . . .&amp;nbsp; right now I have a panel that has the following styles associated with it&lt;/p&gt;
&lt;p&gt;.fixedHeader&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; overflow: auto;&lt;br /&gt;&amp;nbsp;&amp;nbsp; height: 350px;&lt;br /&gt;}&lt;br /&gt;table th&lt;br /&gt;{&lt;br /&gt;&amp;nbsp;&amp;nbsp; border-width: 4px;&lt;br /&gt;&amp;nbsp;&amp;nbsp; border-color: Black;&lt;br /&gt;&amp;nbsp;&amp;nbsp; background-color: Gray;&lt;br /&gt;&amp;nbsp;&amp;nbsp; position: relative;&lt;br /&gt;&amp;nbsp;&amp;nbsp; top: expression(this.parentNode.parentNode.&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; parentNode.scrollTop-1);&lt;br /&gt;}&lt;br /&gt;&lt;br /&gt;and a page that looks kind of like . . .&lt;/p&gt;
&lt;p&gt;&amp;lt;asp:Panel class="fixedheader"&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;asp:UpdatePanel&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;lt;ContentTemplate&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;Gridview&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/Gridview&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/ContentTemplate&amp;gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/asp:UpdatePanel&lt;br /&gt;&amp;lt;/asp:Panel&amp;gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp; When&amp;nbsp;I have the fixedHeader Panel on the outside of the UpdatePanel and the user hits the Edit button, the&amp;nbsp;gridview retains its scroll position but the fixed header disappears after postback.&amp;nbsp; But, when I put the Panel inside of the Update Panel, the scroll returns to the top of the gridview.&amp;nbsp; I really don't know what to do!!!&amp;nbsp; I don't know how to tell the Update panel that it's inside of a fixed header panel!!!!&lt;/p&gt;
&lt;p&gt;&amp;nbsp; Please help!&amp;nbsp; I've literally been struggling with this for DAYS!!!!!&lt;/p&gt;
&lt;p&gt;Karen&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Maintain scroll position of a DIV over a callback</title><link>http://forums.asp.net/thread/1585139.aspx</link><pubDate>Mon, 19 Feb 2007 15:25:08 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1585139</guid><dc:creator>Hoonius</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1585139.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1585139</wfw:commentRss><description>&lt;p&gt;ok, i've amended thwe solution slightly to cope with Micheal's observations&lt;/p&gt;

&lt;p&gt;1 : The code for collecting the scroll postions on the initilizeRequest event was fatally flawed due to it not collecting the postions of a DIV where the user had scrolled to the top. This was due to the clause :&amp;nbsp;&lt;/p&gt;

&lt;pre class="coloredcode"&gt;myDivs[i].scrollTop &amp;gt; 0&lt;/pre&gt;&amp;nbsp; Initially, i had intended to remove this clause so all scroll positions were collected, even when they were at zero.&amp;nbsp; This caused a major problem however. My site, with all it's screen sections, UpdatePanels, Panels etc, my pages ended up having 100+ div controls on the client.&amp;nbsp; Being a cookie n00b, I didn't consider that the cookie collection can only contain 20 values.&amp;nbsp; ASP.NET uses the first one to store the SessionID and the 21st addition was knocking this sessionID out and i was losing Session Data and Login information &lt;a href="http://forums.asp.net/thread/1572073.aspx" target="_blank"&gt;as discussed here&lt;/a&gt;.&amp;nbsp; So, i made a simple custom control, based on a regular asp:Panel which added the folling onScroll attribute in the OnLoad function thus:
&lt;p&gt;&amp;nbsp;&lt;/p&gt;

&lt;pre class="coloredcode"&gt;&lt;b id="1"&gt;1    &lt;/b&gt;&lt;span class="kwd"&gt;protected override void&lt;/span&gt; OnLoad(EventArgs e)&lt;br /&gt;&lt;b id="2"&gt;2    &lt;/b&gt;{&lt;br /&gt;&lt;b id="3"&gt;3    &lt;/b&gt;    &lt;span class="cmt"&gt;//add some javascript to record the scrollTop&lt;/span&gt;
&lt;b id="4"&gt;4    &lt;/b&gt;    &lt;span class="kwd"&gt;this&lt;/span&gt;.Attributes.Add(&lt;span class="st"&gt;"onscroll"&lt;/span&gt;, &lt;span class="st"&gt;"document.cookie = this.id + '=' + this.scrollTop;"&lt;/span&gt;);&lt;br /&gt;&lt;b id="5"&gt;5    &lt;/b&gt;    &lt;span class="kwd"&gt;base&lt;/span&gt;.OnLoad(e);&lt;br /&gt;&lt;b id="6"&gt;6    &lt;/b&gt;}&lt;br /&gt;&lt;/pre&gt;I was then able to remove the collection function and only have the following JavaScriot on my MasterPage:&amp;nbsp;&lt;br /&gt;
&lt;pre class="coloredcode"&gt;&amp;lt;&lt;span class="tag"&gt;script&lt;/span&gt;&lt;span class="attr"&gt; type=&lt;/span&gt;&lt;span class="attrv"&gt;"text/JavaScript"&lt;/span&gt;&amp;gt;&lt;br /&gt;    Sys.WebForms.PageRequestManager.getInstance().add_endRequest(SetDivScrollPosition); &lt;br /&gt;    function SetDivScrollPosition()&lt;br /&gt;    {&lt;br /&gt;        var strCook = document.cookie;&lt;br /&gt;        if(strCook.length &amp;gt; 0)&lt;br /&gt;        {&lt;br /&gt;            var cookies = strCook.split(";");&lt;br /&gt;            for(var i = 0; i &amp;lt; cookies.length; i++)&lt;br /&gt;            {&lt;br /&gt;                var mySplit = cookies[i].split("=");&lt;br /&gt;                try&lt;br /&gt;                {&lt;br /&gt;                    document.getElementById(mySplit[0].replace(" ", "")).scrollTop = mySplit[1];&lt;br /&gt;                }&lt;br /&gt;                catch(e)&lt;br /&gt;                {&lt;br /&gt;                }&lt;br /&gt;             }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;br /&gt;&amp;lt;/&lt;span class="tag"&gt;script&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;p&gt;
Also, i was unable to supress the visual scrolling.  It's only very slight anyway so it wasn't very high on priorities for me
&lt;/p&gt;
&lt;p&gt;So, it's a little more robust now but is still limited to 19 positions, and that's provided you don't use cookies for anything else!!
&lt;/p&gt;
&lt;p&gt;Hope this helps somone though
&lt;/p&gt;
&lt;p&gt;cheers
&lt;/p&gt;
&lt;p&gt;Tim&lt;/p&gt;</description></item><item><title>Re: Maintain scroll position of a DIV over a callback</title><link>http://forums.asp.net/thread/1567307.aspx</link><pubDate>Wed, 07 Feb 2007 10:08:56 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1567307</guid><dc:creator>Hoonius</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1567307.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1567307</wfw:commentRss><description>&lt;p&gt;nicely spotted bugs man.&amp;nbsp; i'll try and fix these today but i can offer these views at this early stage&lt;/p&gt;
&lt;p&gt;1 : This is a bug in my javascript as it only collects the scrollTop if it's greater than zero.&amp;nbsp; you could remove the check for scrollTop &amp;gt; 0 and this should be fixed&lt;/p&gt;
&lt;p&gt;2 : I noticed the visual scrolling part as well.&amp;nbsp; maybe moving the event uip the tree a bit would solve this but i haven't had time to investigate.&amp;nbsp; maybe moving it to the pageLoaded or the pageLoading event would alleviate this problem visually&lt;/p&gt;
&lt;p&gt;&amp;nbsp;However, i saw another solution which doesn't require any javascript at all.&amp;nbsp; i've not had it work with my development pages but the test page provided by the poster worked fine.&amp;nbsp; You should also check this solution as it may give you what you need&lt;/p&gt;
&lt;p&gt;&lt;a href="http://forums.asp.net/thread/1544928.aspx"&gt;http://forums.asp.net/thread/1544928.aspx&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;hope this helps :¬)&lt;/p&gt;</description></item><item><title>Re: Maintain scroll position of a DIV over a callback</title><link>http://forums.asp.net/thread/1567192.aspx</link><pubDate>Wed, 07 Feb 2007 08:20:53 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1567192</guid><dc:creator>darkprojekt</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1567192.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1567192</wfw:commentRss><description>&lt;p&gt;Hi. I have two problems on my page with this solution ...&lt;/p&gt;
&lt;p&gt;1) Scroll to top doesn't work&lt;br /&gt;After a postback with a correctly positioned scroll panel I scroll back to top .. after a postback the scroll panel jumps back to the last scrolled position, not the top position.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;2) Visible jumping&lt;br /&gt;Is there a way to suppress the visible jumping effect?&lt;/p&gt;
&lt;p&gt;Thanks&lt;br /&gt;Michael&lt;/p&gt;</description></item><item><title>Re: Maintain scroll position of a DIV over a callback</title><link>http://forums.asp.net/thread/1553035.aspx</link><pubDate>Mon, 29 Jan 2007 10:35:55 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1553035</guid><dc:creator>Hoonius</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1553035.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1553035</wfw:commentRss><description>&lt;p&gt;been dying IRL to post this solution so here goes&lt;/p&gt;

&lt;p&gt;I've tried allsorts of methods to maintain scroll position in divs.&amp;nbsp; I had it licked in traditional ASP.NET when all the normal page events fired.&amp;nbsp; I could preserve scroll postion using some HTC behavior file and add these saved positions back to their divs when the page reloaded&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;br /&gt;Then came AJAX.&amp;nbsp; I lost most of this functionalty due to the new ways in which pages post themselves back to the server.&amp;nbsp; However, there is a much richer event model to work with now so it should be a bit easier to implement, and there are no amends to make to any existing divs.&lt;/p&gt;

&lt;p&gt;&amp;nbsp;&lt;br /&gt;I added the following methods to my master page in the &amp;lt;script&amp;gt; section:&lt;/p&gt;

&lt;pre class="coloredcode"&gt;    function SaveDivScrollPosition()&lt;br /&gt;    {&lt;br /&gt;        var myDivs = document.getElementsByTagName("div");&lt;br /&gt;        for(var i = 0; i &amp;lt; myDivs.length; i++)&lt;br /&gt;        {&lt;br /&gt;            if(myDivs[i].id.length &amp;gt; 0 &amp;amp;&amp;amp; myDivs[i].scrollTop &amp;gt; 0)&lt;br /&gt;            {&lt;br /&gt;                document.cookie = myDivs[i].id + "=" + myDivs[i].scrollTop; &lt;br /&gt;            }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;    function SetDivScrollPosition()&lt;br /&gt;    {&lt;br /&gt;        var strCook = document.cookie;&lt;br /&gt;        if(strCook.length &amp;gt; 0)&lt;br /&gt;        {&lt;br /&gt;            var cookies = strCook.split(";");&lt;br /&gt;            for(var i = 0; i &amp;lt; cookies.length; i++)&lt;br /&gt;            {&lt;br /&gt;                var mySplit = cookies[i].split("=");&lt;br /&gt;                try&lt;br /&gt;                {&lt;br /&gt;                    document.getElementById(mySplit[0].replace(" ", "")).scrollTop = mySplit[1];&lt;br /&gt;                }&lt;br /&gt;                catch(e)&lt;br /&gt;                {&lt;br /&gt;                }&lt;br /&gt;             }&lt;br /&gt;        }&lt;br /&gt;    }&lt;br /&gt;&lt;/pre&gt;
&lt;p&gt;
Quite simply, the first function gets all divs with an id that have been scrolled and saves the information to the page's cookie collection.&amp;nbsp; The second function collects the cookie data and cycles through, setting the scroll positions. &lt;/p&gt;

&lt;p&gt;All that remains is to get these events fired at the right time.&amp;nbsp; Thanks to the PageRequestManager class, this was easier than I thought.&amp;nbsp; Just underneath the ScriptManager control on my Master page, i added the following lines:&lt;/p&gt;&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;pre class="coloredcode"&gt;&amp;lt;&lt;span class="tag"&gt;script&lt;/span&gt;&lt;span class="attr"&gt; type=&lt;/span&gt;&lt;span class="attrv"&gt;"text/javascript"&lt;/span&gt;&amp;gt;&lt;br /&gt;Sys.WebForms.PageRequestManager.getInstance().add_initializeRequest(SaveDivScrollPosition);&lt;br /&gt;Sys.WebForms.PageRequestManager.getInstance().add_endRequest(SetDivScrollPosition);        &lt;br /&gt;&amp;lt;/&lt;span class="tag"&gt;script&lt;/span&gt;&amp;gt;&lt;/pre&gt;&lt;p&gt;This just wires my functions so that they fire as soon as the callback is requested and when the page has done it's redrawing. Works for me in IE and FireFox :¬)&lt;/p&gt;&lt;p&gt;Hope this helps someone &lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item><item><title>Re: Maintain scroll position of a DIV over a callback</title><link>http://forums.asp.net/thread/1550402.aspx</link><pubDate>Fri, 26 Jan 2007 16:44:31 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1550402</guid><dc:creator>Hoonius</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1550402.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1550402</wfw:commentRss><description>&lt;p&gt;think i've sussed this but will update next week on my findings&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;I was able to attach to the PageRequestManager's endRequest event and fire my positioning function.&amp;nbsp; i'll let you know how this all works next time :¬)&lt;/p&gt;</description></item><item><title>Maintain scroll position of a DIV over a callback</title><link>http://forums.asp.net/thread/1550277.aspx</link><pubDate>Fri, 26 Jan 2007 15:31:10 GMT</pubDate><guid isPermaLink="false">4c671506-2930-414c-a40b-8bf57ded5924:1550277</guid><dc:creator>Hoonius</dc:creator><slash:comments>0</slash:comments><comments>http://forums.asp.net/thread/1550277.aspx</comments><wfw:commentRss>http://forums.asp.net/commentrss.aspx?SectionID=1008&amp;PostID=1550277</wfw:commentRss><description>&lt;p&gt;Hi Guys&lt;/p&gt;

&lt;p&gt;This scroll position thing is doing my nut to put it frankly.&amp;nbsp; I can see plenty of methods on the net using allsorts of techniques ; HTC Behavior, cookies, hidden form fields, MaintainScrollPosition etc.&amp;nbsp; However, none do exactly as i'd like them to&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;They all work when a page is loaded for the first time, no problem there at all.&amp;nbsp; It runs the page load and fires the window.onload function client side no worries and all is well in the world.&amp;nbsp; This window.onload does not see to fire on a callback though and my scroll position is lost forever :¬(.&amp;nbsp; MaintainScrollPositionOnPostBack only maintains the scroll on the main browser screen so that's not going to do the trick either&lt;br /&gt;&lt;/p&gt;

&lt;p&gt;So, does anyone know how to maintain the scroll position of a div over a callback?&amp;nbsp; I think i'm nearly there, if only i could fire a client-side method when my UpdatePanel has done it's callback thang.&amp;nbsp; I found the best looking method using cookies &lt;a href="http://michaelsync.net/2006/06/30/maintain-scroll-position-of-div-using-javascript-aspnet-20/" target="_blank"&gt; Here&lt;/a&gt;&amp;nbsp; but, as said above, i can't get the onload function to fire when a callback completes.&amp;nbsp; if i could get the UpdatePanel to do this, i'd be home and dry&lt;/p&gt;

&lt;p&gt;Please help...&lt;br /&gt;&lt;br /&gt;&amp;nbsp;&lt;/p&gt;</description></item></channel></rss>