日期:2014-05-17 浏览次数:20515 次
<head runat="server">
<title></title>
<script language="javascript" type="text/javascript">
function Button1_onclick() {
if (document.getElementById("Text1").value == "")
{
alert("请填写用户名! ");
return false;
}
if (document.getElementById("Text2").value == "") {
alert("请填写密码! ");
return false;
}
}
// ]]>
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<input id="Text1" type="text"/>
<input id="Text2" type="text"/>
<input id="Button1" type="button" value="button" onclick="return Button1_onclick()" runat="server" /></div>
</form>
</body>
</html>
protected void Button1_Click(object sender, EventArgs e)
{
DataSet ds = new UserBLL().getLogin(TextBox1.Text,TextBox2.Text);
if (ds.Tables[0].Rows.Count > 0)
Response.Write("<script type=\"text/javascript\">top.location.href='Default2.aspx';</script>");