ChatterBox Ajax Modification - Scroll div issue

Topics: General/Misc.
Sep 2, 2008 at 9:57 AM
I needed a small modification of ChatterBoxAjax.
I got a div control on a update panel.
I this div i got a history of user's conversations in last 30 minutes.
This div has style overflow:auto.

displayDiv.Attributes.Add("style", "height: 200px; width: 50%; overflow:auto; background-color:#f5f5f5;");

I need to have this div always scrolled to the bottom, but when I click on send button (on postback) div scrolls to the top.
All logic must be in the webpart, can not use javascript on .aspx or something similar.


When I open page first time I managed to scroll down with this code adding it on the very end of CreateChildCo0ntrols() method.

Page.ClientScript.RegisterStartupScript(GetType(), "myKey", "<script language='javascript' type='text/javascript'>document.getElementById('scrollDivID').scrollTop = 1500;</script>");

Does anyone has any suggestion?

Thanks.