<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/Member/MemberMaster.Master"
    CodeBehind="Message_Send.aspx.cs" Inherits="TopWinCMS.WebUI.Member.Message_Send" %>

<%@ Register TagPrefix="ce" Namespace="CuteEditor" Assembly="CuteEditor" %>
<asp:Content ID="Content" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">

    <script language="javascript" type="text/javascript" src="../JS/Ajax/Ajax.js"></script>

    <script language="javascript" type="text/javascript">
        function CheckUserName()
        {
            var u = document.getElementById('<%=TB_Incept.ClientID%>').value;
            if (u == "") return;

            var Ajax = new AjaxClass();
            Ajax.RequestUrl = "/AjaxPostBack.ashx?Action=CheckUserName";
            Ajax.Method = "post";
            Ajax.IsAsyn = true;
            Ajax.ContentType = "application/x-www-form-urlencoded";
            Ajax.StateChangeEvent = function()
            {
                if (Ajax.XmlHttp.readyState == 4)
                {
                    if (Ajax.XmlHttp.status == 200)
                    {
                        var i = Ajax.XmlHttp.responseText;
                        if (i > 0)
                        {
                            alert("这个用户名存在。可以发短信。");
                        }
                        else
                        {
                            alert("注意！这个用户名不存在，不能发短信。");
                        }
                    }
                }
            };

            var parameters = "&UserName=" + escape(u);
          
            Ajax.Content = parameters;
            Ajax.SendRequest();
        }
    </script>

    <style type="text/css">
        .maintable
        {
            border-style: dotted;
        }
        .style1
        {
            width: 225px;
        }
    </style>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <table align="center" cellpadding="3" cellspacing="1" width="98%" class="maintable">
        <tr>
            <td align="right" width="8%">
                收件人：
            </td>
            <td align="left" class="style1">
                <asp:TextBox ID="TB_Incept" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="请输入"
                    ControlToValidate="TB_Incept"></asp:RequiredFieldValidator>
                <ajaxToolkit:AutoCompleteExtender ID="autoComplete1" runat="server" CompletionInterval="1000"
                    CompletionSetCount="12" EnableCaching="true" MinimumPrefixLength="2" ServiceMethod="GetCompletionList"
                    ServicePath="FindMember.asmx" TargetControlID="TB_Incept">
                </ajaxToolkit:AutoCompleteExtender>
            </td>
            <td id="CheckRow" runat="server" align="left">
                <input id="BT_Check" onclick="CheckUserName();" class="btn" type="button" value="检查用户名" />
            </td>
        </tr>
        <tr>
            <td align="right">
                标题：
            </td>
            <td align="left" colspan="2">
                <asp:TextBox ID="TB_Title" runat="server" Width="331px"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="请输入"
                    ControlToValidate="TB_Title"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr id="PassCodeRow" runat="server">
            <td align="right">
                验证码：
            </td>
            <td align="left" class="style1">
                <asp:TextBox ID="TB_PassCode" runat="server" Width="82px"></asp:TextBox>
                <img alt="点击刷新验证码。" onclick="this.src='../PassCode.ashx'" src="../PassCode.ashx"
                    style="cursor: pointer" />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="请输入"
                    ControlToValidate="TB_PassCode"></asp:RequiredFieldValidator>
            </td>
            <td align="left" width="53%">
                &nbsp;<asp:Button ID="BT_Send" runat="server" OnClick="BT_Send_Click" Text="发送" CssClass="btn" />
                <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ControlToValidate="CE_Content"
                    ErrorMessage="请输入短信内容"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td colspan="3" nowrap="nowrap">
                <ce:Editor ID="CE_Content" runat="server" AutoConfigure="Minimal" Height="300px"
                    ThemeType="Office2003" Width="100%">
                    <FrameStyle Width="100%" Height="100%" BackColor="White" CssClass="CuteEditorFrame"
                        BorderColor="#DDDDDD" BorderStyle="Solid" BorderWidth="1px" />
                </ce:Editor>
            </td>
        </tr>
    </table>
    </form>
</asp:Content>
