ligon页面
protected void btn_login_Click(object sender, EventArgs e)
{
string uname = this.txt_name.Text;
string pwd = this.txt_pwd.Text;
if (ddl_user.SelectedValue == "管理员")
{
Administrator admin = AdministratorBLL.A_login(uname, pwd);
if (admin != null)
{
FormsAuthentication.RedirectFromLoginPage(Convert.ToString(admin.Aid), false);
Response.Redirect("Admin/Admin.aspx");
}
else
{
Response.Write("<script>alert('您不是管理员或者用户名和密码错误')</script>");
}
}
if (ddl_user.SelectedValue == "教师")
{
Teachers teacher = TeacherBLL.Tea_login(uname, pwd);
if (teacher != null)
{
FormsAuthentication.RedirectFromLoginPage(Convert.ToString(teacher.TeaId), false);
Response.Redirect("Teacher/laoshi.aspx");
}
else
{
Response.Write("<script>alert('您不是老师或者用户名和密码错误')</script>");
}
}
if (ddl_user.SelectedValue == "学员")
{
Students student = StudentBLL.Stu_login(uname, pwd);
if (student != null)
{
FormsAuthentication.RedirectFromLoginPage(Convert.ToString(student.StuId), false);
Response.Redirect("Student/xuesheng.aspx");
}
else
{
Response.Write("<script>alert('您不是学生或者用户名和密码错误')</script>");
}
}
admin页面
<style type="text/css">
#div_body {
width: 1010px;
height: 1200px;
margin: 0 auto;
border: 1px solid red;
}#div_middle {
width: 1010px;
height: 35px;
padding-top: 5px;
padding-left: 230px;
}
.span {
color:#ff0033;
padding-left:60px;
}#iframe_right {
width: 770px;
height: 682px;
float: left;
margin-left: 10px;
}
#iframe_left {
width: 230px;
height: 682px;
float: left;
}
</style>
</head>
<body>
<form id="form1" runat="server">
<div id="div_body">
<div id="div_top">
<img src="../image/beijing.jpg" alt="图片位置" width="1010" height="200" />
</div>
<div id="div_middle">
<span class="span">管理员ID:</span>
<asp:Label ID="lb_id" runat="server" Text="未登录"></asp:Label>
<span class="span">管理员姓名:</span>
<asp:Label ID="lb_name" runat="server" Text="未登录"></asp:Label>
<span class="span">权限:</span>
<asp:Label ID="lb_user" runat="server" Text="未登录"></asp:Label>
</div>
<div id="div_bottom">
<iframe id="iframe_left" runat="server" src="../Login.aspx" width="" height="" frameborder="0" scrolling="no"></iframe>
<iframe id="iframe_right" runat="server" src="../Login.aspx" width="" height="" frameborder="0" scrolling="no"></iframe>
</div>
</div>
</form>
</body>