Share via


PasswordRecovery.HelpPageUrl 属性

定义

获取或设置密码恢复帮助页的 URL。

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

属性值

密码恢复帮助页的 URL。 默认值为 Empty

示例

下面的代码示例使用 HelpPageUrl 属性链接到帮助页。 如果用户未正确输入其用户名,则会 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>

注解

属性 HelpPageUrl 包含密码恢复帮助页的 URL。 控件 PasswordRecovery 在“UserName”视图和“问题”视图中显示密码恢复帮助页的链接,但不显示在“成功”视图中。

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

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

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

适用于

另请参阅