擺脫Login控件,自己定義登錄操作
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
//在登錄過程中,程序自動使用login.aspx進行攔截
//驗證用戶通過後,自動返回攔截的位置
if (Membership.ValidateUser(this.TextBox1.Text, this.TextBox2.Text))
{
this.Session["xh"] = this.TextBox1.Text;
FormsAuthentication.RedirectFromLoginPage(this.TextBox1.Text, false);
}
}
Membership用法詳解用戶與角色管理在asp.net2.0中是通過Membership和Roles兩個類來實現的。
1.創建用戶... string userName = txtUsername.Text; } |
轉藏到我的圖書館 獻花(0) +1 分享: 微信 QQ空間 QQ好友 新浪微博 推薦給朋友
來自: glxym > 《asp.net》
以文找文 | 舉報上一篇:asp.net2.0安全性(Login系列控件)
擺脫Login控件,自己定義登錄操作