⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 chatroom.aspx

📁 简单聊天系统,自己做的,有数据库.多多支持,做的不好,请大家原谅.
💻 ASPX
字号:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ChatRoom.aspx.cs" Inherits="ChatRoom" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

<!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 runat="server">
    <title>无标题页</title>
   <link  href="Css/Style.css" type="text/css" rel="stylesheet"/>
    <script language="javascript" type="text/javascript">
    function SelectUser(username)
    {
        document.getElementById("txtToUser").value=username;
    }
    </script>
</head>

<body>
    <form id="form1" runat="server">
    
        <asp:ScriptManager ID="ScriptManager1" runat="server">
        </asp:ScriptManager>
        <br/>
        <cc1:CollapsiblePanelExtender ID="CollapsiblePanelExtender1" runat="server" TargetControlID="left"
        ExpandControlID="image1" CollapseControlID="image1" CollapsedText="显示" ExpandedText="隐藏" ExpandedImage="~/Images/toleft.gif"
               CollapsedImage="~/Images/toright.gif" ImageControlID="image1" >
        
        </cc1:CollapsiblePanelExtender>
        <div style="width:1300px; height:620px;">
        <%--左--%>
        <div style="float:left; height: 705px;">
        <asp:Panel ID="left" runat="server">
        <div id="leftDiv" style="width:180px; height:692px; float:left;"> 
            <cc1:Accordion ID="Accordion1"  runat="server"  HeaderCssClass="headCss">
            
            </cc1:Accordion>  
        </div>
        </asp:Panel>
        </div>
        
        <%--中--%>
        <div id="middle" style="width:25px; height:709px;float:left;">      
        <img id="image1" runat="server" src="~/Images/toleft.gif"  style="margin-top:150px;"/>
        </div>
        
        <%--右--%>
        <div id="right" style="width:616px;height:600px; float:left">
        <strong>欢迎来到新语聊天系统!&nbsp;&nbsp;当前在线人数:</strong><asp:Label ID="count" runat="server"></asp:Label>
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
            <img id="img2" runat="server" src="~/Images/quit.bmp" height="20" /><asp:HyperLink ID="HL" runat="server" Text="安全退出" Font-Bold="True" Font-Size="15px" Width="86px"></asp:HyperLink><br />
            <asp:Timer ID="Timer1" runat="server" Interval="600" OnTick="Timer1_Tick"></asp:Timer>
            <br />
        <asp:UpdatePanel ID="update" runat="server" UpdateMode="conditional">
        <ContentTemplate>
        <asp:DataList ID="dlPublicMessage" runat="server" Width="710px" Height="135px" Visible="true">
            <ItemTemplate>
                <asp:Label ID="lblMessageContent" runat="server"  Font-Bold="True" Font-Size="15px" Text='<%# GetContent(Eval("FormUser.Name").ToString(),Eval("ToUser.Name").ToString()) %>'></asp:Label>&nbsp;
                <asp:Label ID="lblMessage" runat="server"  Font-Bold="True" Font-Size="15px" Text='<%# Eval("Message") %>'></asp:Label>
                <asp:Label ID="lblTime" runat="server"  Font-Bold="True" Font-Size="15px" Text='<%# Eval("RecotrdTime") %>'></asp:Label>
            </ItemTemplate>
        </asp:DataList>
        <hr />
        <asp:DataList ID="dlSecretMessage" runat="server" Width="708px" Height="159px" Visible="false">
            <ItemTemplate>
                <asp:Label ID="lblContent" runat="server" Font-Bold="True" Font-Size="15px" Text='<%#GetContentMessage(Eval("ToUser.Name").ToString())%>' ></asp:Label>
                <asp:Label ID="lblMessage" runat="server"  Font-Bold="True" Font-Size="15px" Text='<%# Eval("Message") %>'></asp:Label>
                <asp:Label ID="lblCurrentTime" runat="server"  Font-Bold="True" Font-Size="15px" Text='<%# Eval("RecotrdTime") %>'></asp:Label>
            </ItemTemplate>
        </asp:DataList>
        </ContentTemplate>
        <Triggers>
        <asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick"/>
        </Triggers>
        </asp:UpdatePanel>
        <hr />
        <asp:UpdatePanel ID="updatePanel2" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
        <cc1:AutoCompleteExtender ID="AutoCompleteExtender1" runat="server" TargetControlID="txtToUser"
     ServicePath="WebService.asmx" ServiceMethod="GetUsersByPreName" CompletionSetCount="10" MinimumPrefixLength="1">
    
    </cc1:AutoCompleteExtender>
        发送对象:<asp:TextBox ID="txtToUser" runat="server" CssClass="inputBox">       
        </asp:TextBox>
        <asp:CheckBox ID="ckBox" runat="server" Checked="false"  Text="是否启用私聊" OnCheckedChanged="ckBox_CheckedChanged" /><br /><br />
        内容:<asp:TextBox ID="txtConetnt" TextMode="multiline" runat="server" Height="50px" Width="348px" ></asp:TextBox>
        <asp:Button ID="btn" runat="server" BackColor="WhiteSmoke" Text="确 定" Width="65px" OnClick="btn_Click"  />
        </ContentTemplate>
        </asp:UpdatePanel>
        </div>
    </div>
    </form>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -