数据库里面设置管理员和普通用户不同的AdmGradeID,如图
后台:
//进入主页
if (dr["AdmGradeID"].ToString().Trim() != "2")
{
ClientScript.RegisterStartupScript(this.GetType(), "", "<script lanuage=javascript>location.href='index.aspx';</script>");
Response.Write("<script language='javascript'>alert('管理员登录成功!');</script>");
}
else
{
ClientScript.RegisterStartupScript(this.GetType(), "", "<script lanuage=javascript>location.href='staffIndex.aspx';</script>");
Response.Write("<script language='javascript'>alert('登录成功!');</script>");
}