PasswordRecovery.SuccessTextStyle 属性

定义

获取对样式属性集合的引用,这些属性定义 PasswordRecovery 控件的“成功”视图中显示的文本外观。

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

属性值

TableItemStyle

TableItemStyle(包含定义“成功”视图中显示的文本的外观的属性)的引用。

属性

示例

下面的代码示例使用 SuccessTextStyle 属性更改属性的外观 SuccessText

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

</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" 
        successtext="Your password has been sent to the email address in our files.">
        <successtextstyle font-names="Arial" forecolor="Green"></successtextstyle>
    </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">

</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" 
        successtext="Your password has been sent to the email address in our files.">
        <successtextstyle font-names="Arial" forecolor="Green"></successtextstyle>
    </asp:passwordrecovery>

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

注解

SuccessTextStyle 属性定义控件成功视图中 PasswordRecovery 文本的外观。 此属性为只读;但是,可以设置它返回的对象的属性 Style 。 可以在窗体 Property-Subproperty中以声明方式设置这些属性,其中 Subproperty 表示 Style 类 (的属性, SuccessTextStyle-ForeColor 例如) 。 还可以以编程方式在窗体 Property.Subproperty (设置属性,例如 SuccessTextStyle.ForeColor ,) 。

常见设置包括自定义背景色、文本颜色和字体属性。

属性的 SuccessTextStyle 样式设置与控件的 PasswordRecovery 样式设置合并。 属性 SuccessTextStyle 中所做的任何设置都会覆盖控件属性 PasswordRecovery 中的相应设置。

以下 PasswordRecovery 属性由 SuccessTextStyle 设置重写:

使用模板定义控件成功视图 PasswordRecovery 的外观时,该 SuccessTextStyle 属性不起作用。

适用于

另请参阅