📄 logincontrol.ascx.cs
字号:
using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class LoginControl : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnLogin_Click(object sender, EventArgs e)
{
UserEntity user = new UserEntity();
UserBussiness userBuss = new UserBussiness();
user.UserName = tbxUserName.Text;
user.Password = tbxPassword.Text;
if (!userBuss.Login(ref user))//若登录失败
{
Common.RegisterAlertAndBackScript("登录失败!请输入正确的用户名和密码!", "Fail", this.Page);
}
else
{
Session["User"] = user;
object fromURL=Request.Params["fromurl"];
if (fromURL == null)
Response.Redirect("default.aspx",true);
else
Response.Redirect(Convert.ToString(fromURL), true);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -