PasswordRecovery.SuccessText 属性

定义

获取或设置成功发送密码后显示的文本。

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

属性值

String

成功发送密码后显示的文本。 默认值为“您的密码已发送给您。”

示例

下面的代码示例将 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>

注解

成功向用户发送密码后,该 SuccessText 属性将显示在“成功”视图中。

属性中的 SuccessTextStyle 样式设置定义属性的外观 SuccessText

使用分配给该属性的 SuccessTemplate 模板时,该 SuccessText 属性不起作用。

SuccessPageUrl如果该属性不是null,则用户将被重定向到属性中SuccessPageUrl定义的页面,并且PasswordRecovery控件的成功视图不会向用户显示。

属性的默认文本基于服务器的区域设置进行本地化。

设置时,此属性的值可以使用设计器工具自动保存到资源文件中。 有关详细信息,请参阅LocalizableAttribute全球化和本地化

适用于

另请参阅