<%@ Register TagPrefix="Title" TagName="TitleShow" Src="/aspnetdata/Title.ascx" %>
<html>
    <script language="C#" runat="server">
        void OK_Click(object sender, EventArgs e)
	{
	if(Password.Value=="" | Name.Text=="")
	{
		Message.Text = "错误，请输入ID及密码";
	}
	else
	{
		if(Name.Text=="abcd")
		{
			if(Convert.ToString((Password.Value)).Length==4)
			{
				string h=Convert.ToString(Password.Value);
				int c=String.Compare(h,"abcd",false);
				if(c==0)
				{
					Response.Redirect("show.aspx?name=" + Name.Text);
				}
				else
				{
					Message.Text = "密码验证错误，请重新输入";
				}
			}
			else
			{
				Message.Text = "密码验证错误，请重新输入";
			}
		}
	}
        }
    </script>
<body background="/aspnetdata/images/winback.gif">
<Title:TitleShow id="BookT" Runat="server" />
      <form runat=server>
          输入ID</font>：<asp:textbox id="Name" runat=server/>(测试ID及密码均为abcd)
          <p>输入密码：<input id="Password" type=password size=10 runat=server>
          <asp:button text="确定" Onclick="OK_Click" runat=server/></p>
           <asp:label id="Message" forecolor="red" font-bold="true" runat=server/>
<asp:label id="rr" runat="server" />
       </form>
   </body>
</html>
