加载中…
个人资料
  • 博客等级:
  • 博客积分:
  • 博客访问:
  • 关注人气:
  • 获赠金笔:0支
  • 赠出金笔:0支
  • 荣誉徽章:
正文 字体大小:

VS Login登录控件实现登录认证

(2013-01-23 21:52:43)
标签:

vs2010

login

it

分类: 编程技法
HTML:

RenderOuterTable="false" onauthenticate="LoginUser_Authenticate">





ValidationGroup="LoginUserValidationGroup"/>


帐户信息


用户名:


CssClass="failureNotification" ErrorMessage="必须填写“用户名”。" ToolTip="必须填写“用户名”。"
ValidationGroup="LoginUserValidationGroup">*



密码:


CssClass="failureNotification" ErrorMessage="必须填写“密码”。" ToolTip="必须填写“密码”。"
ValidationGroup="LoginUserValidationGroup">*




保持登录状态





ValidationGroup="LoginUserValidationGroup" onclick="LoginButton_Click"/>





CS文件注册一个事件外加一个赋值即可:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Account_Login : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
RegisterHyperLink.NavigateUrl = "Register.aspx?ReturnUrl=" + HttpUtility.UrlEncode(Request.QueryString["ReturnUrl"]);
}
protected void LoginButton_Click(object sender, EventArgs e)
{

}
protected void LoginUser_Authenticate(object sender, AuthenticateEventArgs e)
{
//此处省略代码200行
e.Authenticated = true;
}
}

0

阅读 收藏 喜欢 打印举报/Report
  

新浪BLOG意见反馈留言板 欢迎批评指正

新浪简介 | About Sina | 广告服务 | 联系我们 | 招聘信息 | 网站律师 | SINA English | 产品答疑

新浪公司 版权所有