Login.HyperLinkStyle 属性

定义

获取对属性集合的引用,这些属性定义 Login 控件中超链接的外观。Gets a reference to a collection of properties that define the appearance of hyperlinks in the Login 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 properties that define the appearance of hyperlinks.

属性

示例

下面的代码示例 Login 通过设置 TableItemStyle 属性所引用的对象的属性,将控件中的超链接设置为绿色斜体文本 HyperLinkStyleThe following code example sets hyperlinks in the Login control to green italic text by setting properties of the TableItemStyle object referenced by the HyperLinkStyle property.

<%@ Page Language="C#" AutoEventWireup="False"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:Login id="Login1" runat="server" 
            CreateUserText="New user registration..." 
            CreateUserUrl="register.aspx" 
            PasswordRecoveryText="Forgot your password?" 
            PasswordRecoveryUrl="passwordRecovery.aspx"
            HelpPageText="Help logging in..." 
            HelpPageUrl="loginHelp.aspx" >
            <HyperLinkStyle font-italic="True" forecolor="Green">
            </HyperLinkStyle>
        </asp:Login>
    </form>
</body>
</html>
<%@ Page Language="VB" AutoEventWireup="False"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <title>ASP.NET Example</title>
</head>
<body>
    <form id="form1" runat="server">
        <asp:Login id="Login1" runat="server" 
            CreateUserText="New user registration..." 
            CreateUserUrl="register.aspx" 
            PasswordRecoveryText="Forgot your password?" 
            PasswordRecoveryUrl="passwordRecovery.aspx"
            HelpPageText="Help logging in..." 
            HelpPageUrl="loginHelp.aspx" >
            <HyperLinkStyle font-italic="True" forecolor="Green">
            </HyperLinkStyle>
        </asp:Login>
    </form>
</body>
</html>

注解

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

常见设置包括自定义背景色、文本颜色和字体属性。Common settings include custom background color, text color, and font properties. HyperLinkStyle属性定义以下属性的外观:The HyperLinkStyle property defines the appearance of the following properties:

属性的样式设置 HyperLinkStyle 与控件的样式设置合并 LoginThe style settings for the HyperLinkStyle property are merged with the style settings for the Login control. 在属性中进行的任何设置都将 HyperLinkStyle 覆盖控件的属性中的相应设置 LoginAny settings made in the HyperLinkStyle property override the corresponding settings in properties of the Login control.

以下 Login 样式属性被设置重写 HyperLinkStyleThe following Login style properties are overridden by HyperLinkStyle settings:

使用模板定义控件的外观时 LoginHyperLinkStyle 属性不起作用。When you use templates to define the appearance of the Login control, the HyperLinkStyle property has no effect.

适用于

另请参阅