验证用户的身份后出现。Occurs when a user is authenticated.

public:

event System::Web::UI::WebControls::AuthenticateEventHandler ^ Authenticate;

public event System.Web.UI.WebControls.AuthenticateEventHandler Authenticate;

member this.Authenticate : System.Web.UI.WebControls.AuthenticateEventHandler

Public Custom Event Authenticate As AuthenticateEventHandler

事件类型

示例

下面的代码示例使用 Authenticate 事件来调用特定于站点的自定义身份验证代码。The following code example uses the Authenticate event to call site-specific custom authentication code.

private bool SiteSpecificAuthenticationMethod(string UserName, string Password)

{

// Insert code that implements a site-specific custom

// authentication method here.

//

// This example implementation always returns false.

return false;

}

private void OnAuthenticate(object sender, AuthenticateEventArgs e)

{

bool Authenticated = false;

Authenticated = SiteSpecificAuthenticationMethod(Login1.UserName, Login1.Password);

e.Authenticated = Authenticated;

}

ASP.NET Example

OnAuthenticate="OnAuthenticate">

Function SiteSpecificAuthenticationMethod(ByVal UserName As String, ByVal Password As String) As Boolean

' Insert code that implements a site-specific custom

' authentication method here.

'

' This example implementation always returns false.

Return False

End Function

Sub OnAuthenticate(ByVal sender As Object, ByVal e As AuthenticateEventArgs)

Dim Authenticated As Boolean

Authenticated = SiteSpecificAuthenticationMethod(Login1.UserName, Login1.Password)

e.Authenticated = Authenticated

End Sub

ASP.NET Example

OnAuthenticate="OnAuthenticate">

注解

Authenticate当用户使用 Login 控件登录到网站时,将引发事件。The Authenticate event is raised when a user uses the Login control to log in to a Web site. 自定义身份验证方案可以使用 Authenticate 事件对用户进行身份验证。Custom authentication schemes can use the Authenticate event to authenticate users.

备注

当用户使用 Login 控件登录到网站时,视图状态和所有 post 数据中的所有数据都将丢失。When a user uses the Login control to log in to a Web site, all data in the view state and all post data is lost. 不要在依赖于视图状态的事件中执行操作 Authenticate 。Do not perform actions in the Authenticate event that rely on the view state.

有关处理事件的详细信息,请参阅 处理和引发事件。For more information about handling events, see Handling and Raising Events.

继承者说明

自定义身份验证方案应将 Authenticated 属性设置为,以指示已对 true 用户进行身份验证。Custom authentication schemes should set the Authenticated property to true to indicate that a user has been authenticated.

当用户提交其登录信息时, Login 控件首先引发 LoggingIn 事件,然后引发事件 Authenticate ,最后引发 LoggedIn 事件。When a user submits his or her login information, the Login control first raises the LoggingIn event, then the Authenticate event, and finally the LoggedIn event.

适用于

另请参阅

login控件authenticate_Login.Authenticate 事件 (System.Web.UI.WebControls) | Microsoft Docs相关推荐

  1. asp:boundfield html,BoundField 类 (System.Web.UI.WebControls) | Microsoft Docs

    BoundField 类 定义 表示数据绑定控件中以文本形式显示的字段.Represents a field that is displayed as text in a data-bound con ...

  2. html table nowrap,HtmlTableCell.NoWrap 属性 (System.Web.UI.HtmlControls) | Microsoft Docs

    获取或设置一个值,该值指示当到达单元格末尾时,由 HtmlTableCell 类的实例所表示的单元格中的文本是否自动继续在下一行显示.Gets or sets a value indicating w ...

  3. select html value属性,HtmlSelect.DataValueField 属性 (System.Web.UI.HtmlControls) | Microsoft Docs...

    获取或设置数据源中要绑定到 Value 控件中各项的 HtmlSelect 属性的字段.Gets or sets the field from the data source to bind to t ...

  4. asp.net Login控件基本属性及事件说明

    原文:asp.net Login控件基本属性及事件说明 Login系列控件是微软为了简化我们的开发过程,为我们进行常规的安全开发提供块捷途径. Login系列控件包含下列控件: Login 登录控件 ...

  5. login控件authenticate_asp.net Login控件基本属性及事件说明

    当前位置: IT大杂烩 > JavaScript > asp.net Login控件基本属性及事件说明 asp.net Login控件基本属性及事件说明 www.someabcd.com  ...

  6. Cannot convert type ‘ASP.login_aspx’ to ‘System.Web.UI.WebControls.Login’的解决方法

    这是Visual Studio 2005的一个Bug,VS进行网站发布(预编译)后,登录页中的"Login"控件和 .NET Framework 中"System.Web ...

  7. 解决无法将类型为“System.Web.UI.WebControls.HiddenField”的对象强制转换为类型的错误...

    解决无法将类型为"System.Web.UI.WebControls.HiddenField"的对象强制转换为类型的错误 2008-01-04 16:14 本文章将解决: 1.解释 ...

  8. http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.gridview.rowediting.aspx

    http://msdn.microsoft.com/zh-cn/library/system.web.ui.webcontrols.gridview.rowediting.aspx gridview的 ...

  9. 业务逻辑数据层SqlDataSourcesql的输入参数控件参数System.Web.UI.WebControls.GridView.SelectedValue...

    前台代码   1 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="CH7_D ...

最新文章

  1. 19.Oracle10g服务器管理恢复--RMAN表空间恢复(练习33)
  2. eclipse 鲜为人知的调试技巧,你用过多少
  3. 当铺密码解密脚本--[GKCTF2020]汉字的秘密
  4. (android 源码下开发应用程序) 如何在 Android 各 level ( 包含 user space 與 kernel space ) 使用dump call stack的方法...
  5. invokedynamic指令
  6. 循环链表简单操作 C++
  7. 如何去除PDF的水印
  8. Web前端开发技术(第3版)储久良 12.6综合实例
  9. VB全局热键(快捷键)
  10. iOS新机 iPhoneXS max和iPhoneXR适配
  11. linux比较两个文件md5,linux 比较两个文件夹diff不同 (diff命令, md5列表)
  12. 记录一次电脑中病毒后的排查过程
  13. 分享个自己Python爬虫时的浏览器标识库
  14. awk OFS问题说明
  15. 深入理解8583协议
  16. python之路--生成器
  17. gdb、ida调试笔记
  18. 用python三角形_python 三角形
  19. 汽车材料QC/T 942-2013 ELV中六价铬的检测
  20. Springboot 系列(十一)使用 Mybatis(结合自动化生成插件) 访问数据库

热门文章

  1. python3语法错误-Python3 错误和异常
  2. python代码基础题-python3的基础练习题
  3. python使用教程pandas-python学习教程之Numpy和Pandas的使用
  4. head first python 第二版 中文版-Head First Python 中文版
  5. 我自学python的路-Python 学习路线(非常适合小白的入门级教程)
  6. zerodivisionerror什么意思python-Python with as的用法
  7. python零基础怎么学-零基础如何学习Python?老男孩Python入门培训
  8. python经典案例-Python经典实例
  9. python3菜鸟教程中文-Python3 字符串
  10. 光储充一体化充电站_【储能项目】深圳宝清240kW/500kWh光储充电站项目