Click here to Skip to main content
15,881,248 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
This is my file chat.aspx:
XML
<%@ Page Language="vb"  AutoEventWireup="false" MaintainScrollPositionOnPostback="true" CodeBehind="Chat.aspx.vb" Inherits="ChatWindow.Chat" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" >

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
    <title>Chat Application</title>
    <script language="javascript" type="text/javascript">
        function SetScrollPosition()
        {
            var div = document.getElementById('chatbox');
            div.scrollTop = 100000000000;
        }
</script>
</head>
 <body onclick="changeBckMax();" onload="SetScrollPosition()">

     <form id="Form1" runat="server">
     <asp:HiddenField ID="HiddenField1" runat="server"/>
    <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true">
     </asp:ScriptManager>
        <asp:Timer ID="Timer1" OnTick="Timer1_Tick" runat="server" Interval="800" />

     <asp:UpdatePanel ID="UpdatePanel3" UpdateMode="Conditional" runat="server" >
     <ContentTemplate>
        <div>
    <table id="tbl1">
            <tr>
            <td>
                    <p align="left">
        <asp:Label ID="Label3" runat="server" EnableViewState="False"
         Font-Names="Tahoma" Font-Size="X-Large" ForeColor="#0066CC"></asp:Label>
         <asp:Label ID="Lbl_title" runat="server" EnableViewState="False"
        Font-Bold="True" Font-Names="Tahoma"
         Font-Size="X-Large" ForeColor="#0066CC"></asp:Label>
        <br />
        <asp:Label ID="lbl_topic" runat="server" Font-Bold="True" Font-Italic="True"
            Font-Names="Tahoma" Font-Size="Large" ></asp:Label>
        </p>
            </td>
            <td></td>
            <td align="right">
                <asp:Button ID="btn_ChangeTopic" runat="server" Text="Change/Add Topic" OnClick="btn_ChangeTopic_Click" />

                <asp:Button ID="btn_ChangeProject" runat="server" Text="Change Project" OnClick="btn_changeProject_Click"/>
            </td>
            </tr>
    <tr>
        <td class="style1">
            <div id="wrapper" >
                <div id="menu">
                    <p class="welcome">Welcome,
                        <asp:Label ID="Lbl_user" runat="server" Text="" style="font-weight:bold"></asp:Label>&nbsp;&nbsp;&nbsp; &nbsp&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:LinkButton ID="lnk_recentMsgs" runat="server" CssClass="GoToPrevConv" OnClientClick="eval(this.href);return false">Go To Previous Conversation</asp:LinkButton>
                        <asp:LinkButton ID="lnk_currentConv" runat="server" Style="text-decoration:underline" OnClientClick="eval(this.href);return false">Go To Current Conversation</asp:LinkButton>
                        </p>
                    <p class="logout">

                        <asp:LinkButton ID="Lnkbtn_exit" runat="server" CssClass="ExitLink" ToolTip="Exit Conversation" OnClientClick="return ConfirmOnExit();">Exit Chat</asp:LinkButton></p>
                    <div style="clear:both"></div>
                </div>
                <div id="chatbox" onresize="SetScrollPosition()">

                         <asp:UpdatePanel ID="MessagePanel" runat="server" >
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="Timer1" />
                    </Triggers>
                    <ContentTemplate>


                        <asp:Panel ID="Panel1" runat="server" Height="233px"
                            Width="410px"  >

                        </asp:Panel>
                    </ContentTemplate>
                    </asp:UpdatePanel>
                </div>
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                 <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="Timer1" />
                    </Triggers>
                    <ContentTemplate>
                <asp:Panel ID="pan_LastMsgTime" runat="server" Height="19px"   Width="433px" BackColor="#EBF4FB" >

                        </asp:Panel>
                         </ContentTemplate>
                </asp:UpdatePanel>
                       <hr size="3px" style="border-color: #0066CC" />

               <table >
               <tr>
               <td>

                <asp:TextBox ID="txt_msg" runat="server" size="63" style="text-align: left"
                    TextMode="MultiLine" Width="420px" Height="30px" ToolTip="Enter your message here"></asp:TextBox>
               </td>
                 <td>&nbsp;&nbsp;<asp:Button ID="btn_submit" runat="server" Text="Send"
                         Font-Bold="True" ToolTip="Send Message" OnClientClick="SetScrollPosition();"
                         /></td>

                 </tr>
                 </table>
</div>
        </td>
        <td class="style1">
                <div id="div_users">

                <asp:UpdatePanel ID="UsersUpdatePanel" runat="server" >
                    <Triggers>
                        <asp:AsyncPostBackTrigger ControlID="Timer1" />
                    </Triggers>
                    <ContentTemplate>
                      <asp:Panel ID="Panel2" runat="server"
                            style="height: 395px; width:128px" Height="415px" ToolTip="Online Team-Members" >
                            <br/>
                          <asp:Label ID="Label1" runat="server" style="font-weight:bold"  >Online TeamMembers:</asp:Label><br />
                            </asp:Panel>

                    </ContentTemplate>
                    </asp:UpdatePanel>


                </div>
        </td>
       <td></td>
    </tr>

    </table>
 </div>
 </ContentTemplate>
     </asp:UpdatePanel>
     </form>
</body>
</html>

and following is the stylesheet code

CSS
#chatbox {
    text-align:left;
    margin-bottom:4px;
    padding:5px;
    background:#F5F5F5;
    height:260px;/*277*/
    width:430px;
    border:1px solid #ACD8F0;
    overflow-y:scroll;/*overflow:auto;*/
    margin-left: auto;
    margin-right: auto;
    margin-top: 0;


}
Posted
Comments
DamithSL 16-May-14 5:09am    
what is the question?
[no name] 16-May-14 6:48am    
@DamithSL i have specified every detail jst check it correctly I have given the code snippert as well as stylesheet code.
CHill60 16-May-14 9:58am    
Because you put your question into the title instead of the body of your post it has been truncated. Every time you press Send....what?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900