<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="SelectUser.ascx.cs" Inherits="PowerEasy.Module.General.WebSite.Admin.Controls.FieldControl.SelectUser" %>
<div class="DivWordBreak">
<asp:TextBox ID="TxtSelectUser" onblur="CheckUserName(this.value);" runat="server"></asp:TextBox><pe:ExtendedLiteral ID="ELtrSelectUser" HtmlEncode="false" runat="server"></pe:ExtendedLiteral><pec:FloatingDialog ID="FdSelectUser" runat="server" Width="670" Height="400" Name="<%$ Res : Controls_FieldControl_SelectUser_FdSelectUser_Name , 会员列表 %>" BeginString="【" EndString="】"
                Skin="floatingDialogFontSkin" Title="<%$ Res : Controls_FieldControl_SelectUser_FdSelectUser_Title , 会员列表 %>" LoadUrl="../User/UserNameList.aspx?Select=single" />
<pe:RequiredFieldValidator ID="ReqTxtKeyWord" runat="server" SetFocusOnError="true"
        Display="Dynamic" ErrorMessage="<%$ Res : Controls_FieldControl_SelectUser_ReqTxtKeyWord , 会员不能为空 %>" Visible="false" ControlToValidate="TxtSelectUser"></pe:RequiredFieldValidator><span runat="server" id="SpanCheckUserName" style="display:none; color:Red;">您选择的用户不存在！</span>
        <script type="text/javascript">

            function DoPostBack(username) {
                document.getElementById("<%= TxtSelectUser.ClientID %>").value = username;
                CheckUserName(username);
            }

            function CheckUserName(username) {
                jQuery.post("<%= BasePath %>" + 'ajax.aspx', "<?xml version='1.0' encoding='utf-8'?><root><type>usercheck</type><username>" + username + "</username></root>", function(s) {
                    var status = $("status", s).text();
                    if (status == "ok") {
                        document.getElementById("<%= SpanCheckUserName.ClientID %>").style.display = "";
                    }
                    else {
                        document.getElementById("<%= SpanCheckUserName.ClientID %>").style.display = "none";
                    }
                });
            }
        
    </script>
</div>

