Share via


PasswordRecovery.HelpPageText 属性

定义

获取或设置指向密码恢复帮助页的链接的文本。

public:
 virtual property System::String ^ HelpPageText { System::String ^ get(); void set(System::String ^ value); };
public virtual string HelpPageText { get; set; }
member this.HelpPageText : string with get, set
Public Overridable Property HelpPageText As String

属性值

指向密码恢复帮助页的链接的文本。 默认值为 Empty

示例

下面的代码示例使用 HelpPageText 属性链接到帮助页。 如果用户未正确输入其用户名,则 UserLookupError 事件处理程序用于突出显示链接。

<%@ page language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

    void PasswordRecovery1_UserLookupError(object sender, EventArgs e)
    {
        PasswordRecovery1.HelpPageText = "Need help with recovering your password?";
        PasswordRecovery1.HyperLinkStyle.BackColor = System.Drawing.Color.DarkGreen;
        PasswordRecovery1.HyperLinkStyle.ForeColor = System.Drawing.Color.White;
    }
    
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
    <asp:passwordrecovery id="PasswordRecovery1" runat="server"
      helppagetext="Help with recovering your password" 
      helppageurl="recoveryHelp.aspx" OnUserLookupError="PasswordRecovery1_UserLookupError">
        <hyperlinkstyle backcolor="#E0E0E0"></hyperlinkstyle>
    </asp:passwordrecovery>

</form>
</body>
</html>
<%@ page language="VB" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script runat="server">

    
    Sub PasswordRecovery1_UserLookupError(ByVal sender As Object, ByVal e As System.EventArgs)
        PasswordRecovery1.HelpPageText = "Need help with recovering your password?"
        PasswordRecovery1.HyperLinkStyle.BackColor = System.Drawing.Color.DarkGreen
        PasswordRecovery1.HyperLinkStyle.ForeColor = System.Drawing.Color.White
    End Sub
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
    <asp:passwordrecovery id="PasswordRecovery1" runat="server"
      helppagetext="Help with recovering your password" 
      helppageurl="recoveryHelp.aspx" OnUserLookupError="PasswordRecovery1_UserLookupError">
        <hyperlinkstyle backcolor="#E0E0E0"></hyperlinkstyle>
    </asp:passwordrecovery>

</form>
</body>
</html>

注解

属性 HelpPageText 包含密码恢复帮助页的链接文本。 如果在 属性中 HelpPageText 指定了 URL,控件会在 PasswordRecovery “UserName”视图和“问题”视图中显示有关密码恢复的信息的链接,但不显示在“成功”视图中。

如果 属性 HelpPageUrl 设置为 Empty,则不显示链接。

帮助页面链接的外观由 HyperLinkStyle 属性定义。

使用模板定义控件的外观 PasswordRecovery 时, HelpPageTextHelpPageUrl 属性不起作用。

设置此属性的值时,可以使用设计器工具自动保存到资源文件。 有关详细信息,请参阅 LocalizableAttribute全球化和本地化

适用于

另请参阅