PasswordRecovery.HyperLinkStyle 属性

定义

获取对属性集合的引用,这些属性定义 PasswordRecovery 控件上超链接的外观。Gets a reference to a collection of properties that define the appearance of hyperlinks on the PasswordRecovery control.

public:
 property System::Web::UI::WebControls::TableItemStyle ^ HyperLinkStyle { System::Web::UI::WebControls::TableItemStyle ^ get(); };
[System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)]
public System.Web.UI.WebControls.TableItemStyle HyperLinkStyle { get; }
[<System.Web.UI.PersistenceMode(System.Web.UI.PersistenceMode.InnerProperty)>]
member this.HyperLinkStyle : System.Web.UI.WebControls.TableItemStyle
Public ReadOnly Property HyperLinkStyle As TableItemStyle

属性值

TableItemStyle

TableItemStyle(包含定义超链接外观的设置)的引用。A reference to the TableItemStyle that contains the settings that define the appearance of hyperlinks.

属性

示例

下面的代码示例使用 HyperLinkStyle 属性在用户输入在控件中的数据存储区中找不到的用户名时,突出显示 "帮助页面" 链接 PasswordRecoveryThe following code example uses the HyperLinkStyle property to highlight the Help page link when a user enters a user name that is not found in the data store in the PasswordRecovery control.

<%@ 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>

注解

HyperLinkStyle属性定义属性的外观 HelpPageTextThe HyperLinkStyle property defines the appearance of the HelpPageText property. 此属性是只读的;但是,您可以设置 Style 它返回的对象的属性。This property is read-only; however, you can set the properties of the Style object it returns. 可以在窗体中以声明方式设置这些属性 Property-Subproperty ,其中 Subproperty 表示类的属性 Style (例如 HyperLinkStyle-ForeColor) 。The properties can be set declaratively in the form Property-Subproperty, where Subproperty represents a property of the Style class (for example, HyperLinkStyle-ForeColor). 您还可以通过编程方式设置属性 Property.Subproperty , (例如 HyperLinkStyle.ForeColor) 。You can also set the properties programmatically in the form Property.Subproperty (for example, HyperLinkStyle.ForeColor).

常见设置包括自定义背景色、文本颜色和字体属性。Common settings include custom background color, text color, and font properties.

属性的样式设置 HyperLinkStylePasswordRecovery 控件样式设置合并在一起。The style settings for the HyperLinkStyle property are merged with PasswordRecovery control style settings. 在属性中进行的任何设置都将 HyperLinkStyle 覆盖控件的属性中的相应设置 PasswordRecoveryAny settings made in the HyperLinkStyle property override the corresponding settings in properties of the PasswordRecovery control.

以下属性由设置重写 HyperLinkStyleThe following properties are overridden by HyperLinkStyle settings:

使用模板定义 PasswordRecovery 控件的 "用户名" 视图或 "问题" 视图的外观时, HyperLinkStyle 属性不起作用。When you use templates to define the appearance of the PasswordRecovery control's UserName view or Question view, the HyperLinkStyle property has no effect.

适用于

另请参阅