Hi
I need to scroll up the div as the new text comes in. My div is in Updatepanel and i am getting this error "get("divChatMessage") is null" Here is my code:-
<script type="text/javascript">
function ScrollToBottom()
{
$get('divChatMessage').scrollTop = $get('divChatMessage').scrollHeight;
}
</script>
<div id="divMessage" runat="server" style="float: left">
<asp:UpdatePanel ID="upMessage" runat="server">
<ContentTemplate>
<div id="divChatMessage" style="width:600px; overflow:auto; height:200px; border-style:solid;" runat="server">
</div>
</ContentTemplate>
</asp:UpdatePanel>
</div>
code behind:-
divChatMessage.InnerHtml = divChatMessage.InnerHtml + "<br />" + message;
ScriptManager.RegisterStartupScript(this,
this.GetType(),
Guid.NewGuid().ToString(),
";ScrollToBottom();",
true);