<%@ Page Language="C#" AutoEventWireup="true" Codebehind="GetPwd.aspx.cs" Inherits="MyITJob.GetPwd" %>
<%@ Register TagPrefix="ascx" TagName="PageTop" Src="~/ascx/PageTop.ascx" %>
<%@ Register TagPrefix="ascx" TagName="PageFooter" Src="~/ascx/PageFooter.ascx" %>
<!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>
<title><%=Application["PageTitle"] %>- 企业/会员登陆，密码找回页面</title>
<meta name="Keywords" content="<%=Application["PageKeywords"] %>" />
<meta name="Description" content="<%=Application["Pagede"] %>" />
<link href="<%=s_style %>" rel="stylesheet" type="text/css" />
<link href="images/login.css" rel="stylesheet" type="text/css" />
<script language="javascript" src="/js/Prototype.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div><ascx:PageTop ID="PageTop" runat="server" /></div>
<div id="loginall">
  <div id="top">
    <div id="top_left"><img src="images/login_03.gif" /></div>
    <div id="top_center"></div>
  </div>
  <div id="center">
    <div id="center_left"></div>
    <asp:Panel ID="EditPwd" runat="server">
    <div class="logintxt"><span class="txta">用户身份</span>
        <asp:DropDownList ID="DropDownList1" runat="server">
            <asp:ListItem Selected="True">个人用户</asp:ListItem>
            <asp:ListItem>企业用户</asp:ListItem>
        </asp:DropDownList>
      </div>
      <div class="logintxt"><span class="txta">用户名</span>
        <asp:TextBox ID="uname" runat="server" MaxLength="14" onBlur="jsname();"></asp:TextBox><br />
      </div>
      <div class="logintxt"><span class="txta">提示问题</span>
        <asp:TextBox ID="question" runat="server" MaxLength="14"></asp:TextBox>
      </div>
      <div class="logintxt"><span class="txta">提示答案</span>
        <asp:TextBox ID="answer" runat="server" MaxLength="14"></asp:TextBox>
      </div>
      <div id="btn">
        <asp:Button ID="NextButton1" runat="server" Text="在线修改" OnClick="NextButton1_Click" /><asp:Button ID="Email_Button" runat="server" Text="邮箱找回" OnClick="Email_Button_Click" /><br />
        <asp:Label ID="Label3" runat="server" ForeColor="Red"></asp:Label>
      </div>
      </asp:Panel>
    <asp:Panel ID="Over" runat="server">
      <div class="logintxt"><span class="txta">用户名</span>
        <asp:Label ID="Label1" runat="server" ForeColor="Red"></asp:Label>
      </div>
      <div class="logintxt"><span class="txta">新密码</span>
        <asp:TextBox ID="NewPwd" runat="server" MaxLength="14" TextMode="Password"></asp:TextBox>
      </div>
      <div class="logintxt"><span class="txta">确认密码</span>
        <asp:TextBox ID="NewPwd2" runat="server" MaxLength="14" TextMode="Password"></asp:TextBox>
      </div>
      <div id="btn">
        <asp:Button ID="OverButton" runat="server" Text="修改密码" OnClick="OverButton_Click" />
        <asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="NewPwd" ControlToValidate="NewPwd2"
                                                                ErrorMessage="两次输入的密码不同"> </asp:CompareValidator>
      </div>
      </asp:Panel>
    <div id="center_right"></div>
  </div>
  <div id="down">
    <div id="down_left">
      <div id="inf"> <span class="inf_text">常用服务</span> <span class="copyright"> <a href="../Default.aspx">网站首页</a> <a href="/PersonDH/Index.aspx">求职--找工作</a> <a href="Person/Default.aspx">投简历</a> <a href="CompanyDH/Index.aspx">最新人才库</a> <a href="/newsall.aspx" >职场百科</a> <a href="Company/Default.aspx">发布职位</a></span> </div>
    </div>
    <div id="down_center"></div>
  </div>
<div style="margin-top: 8px; clear:both;"><ascx:PageFooter ID="PageFooter" runat="server" /></div>
</div>
</form>
</body>
</html>
<script language="javascript" type="text/javascript">
var Action;
function jsname(){
    var ddl = document.getElementById("DropDownList1");
    var uname = document.getElementById("uname");
    var unamespan = document.getElementById("Label3");
    var question = document.getElementById("question");
    if(ddl.value == '个人用户'){
        Action = 'jsaction=person&name=' + uname.value;
    }else{
        Action = 'jsaction=company&name=' + uname.value;
    }
    
    var options = {
        method:'get', parameters:Action, onComplete:function(HTML){
            var returnvalue = HTML.responseText;
            if(returnvalue != '0'){
                unamespan.style.display = 'none';
                question.value = returnvalue;
            }else{
                unamespan.style.display = '';
                unamespan.innerHTML = '用户名不属于该身份';
                question.value = '';
                uname.focus();
                return;
            }
        }
    };
    new Ajax.Request('GetPwd.aspx', options);
}
</script>