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 屬性不會有任何作用。

適用於

另請參閱