<%@ page language="C#" autoeventwireup="true" inherits="ims.reg, ims.web" enableviewstatemac="false" enableEventValidation="false" %>
<!DOCTYPE html>
<html id="reg">
<head runat="server">
    <title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width,initial-scale=1">
</head>
<body>
    <form id="form1" runat="server">
    <div class="hide"><input type="password" /></div>
        <asp:ScriptManager ID="s1" runat="server" OnAsyncPostBackError="AsyncError">
            <CompositeScript Path="js/msajax.js" ScriptMode="Release">
                <Scripts>
                    <asp:ScriptReference Name="WebForms.js" Assembly="System.Web" /><asp:ScriptReference Name="MicrosoftAjax.js" /><asp:ScriptReference Name="MicrosoftAjaxWebForms.js" />
                </Scripts>
            </CompositeScript>
        </asp:ScriptManager>
        <asp:ValidationSummary ID="ValSum" runat="server" ShowMessageBox="True" ShowSummary="False"></asp:ValidationSummary>
        <div class="pageTitle"><%= Title %></div>
        <table class="hr allhover mbottom_s mtop_l">
            <tr runat="server" id="tr_UserName">
                <td class="col1">用户名<span class="required">*</span>：</td>
                <td class="col2">
                    <asp:UpdatePanel ID="up1" RenderMode="inline" runat="server">
                        <ContentTemplate>
                            <asp:TextBox runat="server" ID="userName" OnTextChanged="chkName" AutoPostBack="true" MaxLength="50"></asp:TextBox>
                        </ContentTemplate>
                    </asp:UpdatePanel>
                    <asp:RequiredFieldValidator SetFocusOnError="true"
                        ID="RequiredVal_userName" ControlToValidate="userName" runat="server" Display="None" ErrorMessage="请输入用户名！"></asp:RequiredFieldValidator></td>
            </tr>
            <tr runat="server" id="tr_realName">
                <td class="col1">真实姓名<span class="required" runat="server" id="required_realName">*</span>：</td>
                <td class="col2">
                    <asp:TextBox runat="server" ID="realName" MaxLength="50"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredVal_realName" runat="server" ControlToValidate="realName" ErrorMessage="请输入真实姓名！" Display="None"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularVal_realName" runat="server" SetFocusOnError="true" ValidationExpression=".{2,50}" ControlToValidate="realName" Display="None" ErrorMessage="姓名长度必须介于2到50之间！"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr runat="server" id="tr_Sex">
                <td class="col1">性别：</td>
                <td class="col2">
                    <asp:RadioButtonList runat="server" ID="sex" RepeatDirection="Horizontal" RepeatLayout="Flow">
                        <asp:ListItem Text="男 " Value="true" Selected="True" />
                        <asp:ListItem Text="女" Value="false" />
                    </asp:RadioButtonList></td>
            </tr>
            <tr runat="server" id="tr_PassWord">
                <td class="col1">登录密码<span class="required">*</span>：</td>
                <td class="col2">
                    <asp:TextBox runat="server" TextMode="Password" ID="passWord" MaxLength="128"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredVal_passWord" runat="server" ControlToValidate="passWord" ErrorMessage="请输入密码！" Display="None"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularVal_passWord" runat="server" SetFocusOnError="true" ValidationExpression="^\S{3,128}$" ControlToValidate="passWord" Display="None" ErrorMessage="输入的密码不符合要求！"></asp:RegularExpressionValidator></td>
            </tr>
            <tr runat="server" id="tr_rePassWord">
                <td class="col1">确认密码<span class="required">*</span>：</td>
                <td class="col2">
                    <asp:TextBox ID="rePassWord" TextMode="Password" runat="server" MaxLength="128" ToolTip="请再输入一次密码，以确认输入是正确的"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredVal_rePassWord" runat="server" ControlToValidate="rePassWord" ErrorMessage="请输入确认密码！" Display="None"></asp:RequiredFieldValidator>
                    <asp:CompareValidator ID="CompareVal_rePassWord" runat="server" ControlToCompare="passWord"
                        ControlToValidate="rePassWord" Display="None" ErrorMessage="两次密码输入不一致！"></asp:CompareValidator></td>
            </tr>
            <tr runat="server" id="tr_Phone">
                <td class="col1">电话号码<span class="required" runat="server" id="required_phone">*</span>：</td>
                <td class="col2">
                    <asp:TextBox runat="server" AutoCompleteType="BusinessPhone" ID="phone"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredVal_phone" runat="server" ControlToValidate="phone" ErrorMessage="请输入电话号码！" Display="None"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularVal_phone" runat="server" SetFocusOnError="true" ValidationExpression=".{7,}" ControlToValidate="phone" Display="None" ErrorMessage="请输入有效的电话号码！"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr runat="server" id="tr_Weixin">
                <td class="col1">微信帐号<span class="required" runat="server" id="required_wxAccount">*</span>：</td>
                <td class="col2">
                    <asp:TextBox runat="server" ID="wxAccount" ToolTip="请输入微信帐号，以便接收可能由系统发出的微信消息"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredVal_wxAccount" runat="server" ControlToValidate="wxAccount" ErrorMessage="请输入微信帐号！" Display="None"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularVal_wxAccount" runat="server" SetFocusOnError="true" ValidationExpression="\S{2,50}" ControlToValidate="wxAccount" Display="None" ErrorMessage="请输入有效的微信帐号！"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr runat="server" id="tr_Address">
                <td class="col1">地址<span class="required" runat="server" id="required_address">*</span>：</td>
                <td class="col2">
                    <asp:TextBox runat="server" AutoCompleteType="BusinessStreetAddress" ID="address" ToolTip="请输入详细的联系地址，以便必要时提供递送服务"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredVal_address" runat="server" ControlToValidate="address"
                        Display="None" ErrorMessage="请输入地址！"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularVal_address" runat="server" ControlToValidate="address"
                        Display="None" ErrorMessage="请输入有效的联系地址！" SetFocusOnError="true" ValidationExpression=".{2,}"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr runat="server" id="tr_Zip">
                <td class="col1">邮编<span class="required" runat="server" id="required_zip">*</span>：</td>
                <td class="col2">
                    <asp:TextBox runat="server" AutoCompleteType="BusinessZipCode" ID="zip"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredVal_zip" runat="server" ControlToValidate="zip"
                        Display="None" ErrorMessage="请输入邮编！"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularVal_zip" runat="server" ControlToValidate="zip"
                        Display="None" ErrorMessage="请输入有效的邮政编码！" SetFocusOnError="true" ValidationExpression="\d{6}"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr runat="server" id="tr_Question">
                <td class="col1">密码问题<span class="required" runat="server" id="required_question">*</span>：</td>
                <td class="col2">
                    <asp:TextBox runat="server" ID="question" ToolTip="找回密码的提示问题"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredVal_question" runat="server" ControlToValidate="question"
                        Display="None" ErrorMessage="请输入密码问题！"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr runat="server" id="tr_Answer">
                <td class="col1">问题答案<span class="required" runat="server" id="required_answer">*</span>：</td>
                <td class="col2">
                    <asp:TextBox runat="server" ID="answer" ToolTip="找回密码的问题答案"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredVal_answer" runat="server" ControlToValidate="answer"
                        Display="None" ErrorMessage="请输入问题答案！"></asp:RequiredFieldValidator>
                </td>
            </tr>
            <tr runat="server" id="tr_Email">
                <td class="col1">电子邮箱<span class="required" runat="server" id="required_email">*</span>：</td>
                <td class="col2">
                    <asp:TextBox runat="server" AutoCompleteType="Email" ID="email" ToolTip="请输入邮箱地址，以便必要时联系或取回密码"></asp:TextBox>
                    <asp:RequiredFieldValidator ID="RequiredVal_email" runat="server" ControlToValidate="email"
                        Display="None" ErrorMessage="请输入电子邮箱！"></asp:RequiredFieldValidator>
                    <asp:RegularExpressionValidator ID="RegularVal_email" runat="server" ControlToValidate="email"
                        Display="None" ErrorMessage="请输入有效的电子邮箱！" SetFocusOnError="true" ValidationExpression="^\w[\w\.-]*@\w[\w\.-]*\.[a-zA-Z]{2,4}"></asp:RegularExpressionValidator>
                </td>
            </tr>
            <tr runat="server" id="tr_Vcode">
                <td class="col1">验证码<span class="required">*</span>：</td>
                <td class="col2">
                    <asp:TextBox runat="server" ID="vcode" ToolTip="请输入验证码（右边图片中显示的字符）"></asp:TextBox>
                    <img src="vcode.aspx" title="验证码。若看不清楚，请点击以刷新。" style="cursor:pointer;height:19px;vertical-align:top" onclick="this.src='vcode.aspx?time='+new Date().getTime();" /></td>
            </tr>
        </table>
        <asp:CheckBox runat="server" ID="AutoLogin" Checked="true" Text="注册后自动登录" />
        <div runat="server" id="agreement" visible="false" class="middle mtop_s">
            <asp:CheckBox runat="server" ID="cbArgee" Text="同意" /><a href="agreement.htm" onclick="return toPopup(this.href);">用户协议</a>
        </div>
        <asp:UpdatePanel ID="footup" RenderMode="Block" runat="server" class="footBtnArea">
            <ContentTemplate>
                <input class="btn" type="button" id="btnSubmit" value="注册" runat="server" onclick="return toReg();" onserverclick="submit" />
                <input type="button" runat="server" id="btnChgpwd" value="修改密码" class="btn" onclick="return ShowPop('pwd_popup');" />
                <input type="button" onclick="back();" value="返回" class="btn" />
            </ContentTemplate>
        </asp:UpdatePanel>
        <ims:Pop runat="server" ID="pwd" Title="修改密码" Width="366" OnOkClick="ChangePwd" OnOkClientClick="return PreChangePwd();" HideOnOkClientClick="false">
        <ContentTemplate>
            <table class="mtop_m comm">
                <tr><td class="right" style="width:33%;min-width:6.1em">原密码：</td><td><asp:TextBox runat="server" autocomplete="off" TextMode="Password" ID="tbOldPwd"></asp:TextBox></td></tr>
                <tr><td class="right">新密码：</td><td><asp:TextBox runat="server" TextMode="Password" ID="tbNewPwd" autocomplete="off"></asp:TextBox></td></tr>
                <tr><td class="right">确认新密码：</td><td><asp:TextBox runat="server" TextMode="Password" ID="tbVerify" autocomplete="off"></asp:TextBox></td></tr>
            </table>
        </ContentTemplate>
        </ims:Pop>
        <script src="js/comm.js"></script>
        <script>
            $(function () {
                if (isPc) $("td input[title]").poshytip();
            });
            function toReg() {
                var ok = $("#cbArgee").length == 0 || $("#cbArgee").prop("checked");
                if (!ok) return showAndExit("必须勾选\"同意用户协议\"才能注册！");
                if (typeof (Page_ClientValidate) == 'function') Page_ClientValidate('');
                __doPostBack('btnSubmit', '');
                return false;
            }
            function PreChangePwd() {
                if ($("#pwd_tbOldPwd").val() == "") return showAndExit("请输入原密码！");
                if ($("#pwd_tbNewPwd").val().length < 3) return showAndExit("请输入有效的新密码！");
                if ($("#pwd_tbVerify").val() == "") return showAndExit("请输入确认新密码！");
                if ($("#pwd_tbVerify").val() != $("#pwd_tbNewPwd").val()) return showAndExit("两次输入的新密码不一致！");
                return true;
            }
        </script>
    </form>
</body>
</html>
