using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Web.Bll;
using Web.Mod;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Button1_Click(object sender, EventArgs e)
{
//login
try
{
string name = TextBox1.Text.Trim();
string pass = TextBox2.Text.Trim();
Admin a = AdminMananger.GetByName(name);
if (a == null || a.Pass != pass)
Response.Write("<script>alert('用户名或密码错误!');</script>");
else
{
Session["admin"] = a;
Response.Redirect("Main.aspx");
}
}
catch {
Response.Write("<script>alert('用户名或密码错误!');</script>");
}
}
protected void Button2_Click(object sender, EventArgs e)
{
this.TextBox1.Text = "";
TextBox2.Text = "";
}
}