hi techies,
i am developing chat application using vb.net and asp.net where i am having a div tag inside which i am displaying the messages posted by the online users what my problem is when the messages are more and exceeds the height of the div tag then i am not comfortable to view the previous messages because i have set the scroll bar position to always to be pointed to bottom,
for clarity i have pasted my code please go through it and suggest your ideas
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<div id="ChatContent" runat="server" style="height: 250px; vertical-align: top; overflow:auto; text-align: left; margin-left: 10px; width: 97%;">
</div>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel3" runat="server"UpdateMode="Conditional">
<ContentTemplate>
<textarea id="UserInputTextBox" cols="72" rows="3" runat="server" onkeyup="if(event.keyCode == 13) Button2.click();" >
</textarea>
<asp:Button ID="Button2" runat="server" CssClass="button" Text="Send" OnClick="Button2_Click" UseSubmitBehavior="False" />
<script type="text/javascript">
Sys.Application.add_load(function() {
var t = document.getElementById('ChatContent');
t.scrollTop = t.scrollHeight;
});
</script>
</ContentTemplate>
</asp:UpdatePanel>
Thanks
Shakthi