Login.InstructionText 屬性

定義

取得或設定使用者的登入指示文字。

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

屬性值

要顯示給使用者的登入指示文字。 預設為 Empty

範例

下列程式碼範例會 InstructionText 使用 屬性在 控制項中 Login 插入指令文字。

<%@ 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" 
            InstructionText="Enter your user name and password to log in.">
        <InstructionTextStyle Font-Bold="True" ForeColor="#E0E0E0" BackColor="Gray"></InstructionTextStyle>
        </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" 
            InstructionText="Enter your user name and password to log in.">
        <InstructionTextStyle Font-Bold="True" ForeColor="#E0E0E0" BackColor="Gray"></InstructionTextStyle>
        </asp:Login>
    </form>
</body>
</html>

備註

屬性 InstructionText 包含使用者登入網站的指示。 此文字會顯示在 控制項中 Login ,並遵循標題。

InstructionText如果 屬性設定為 Empty ,則使用者沒有可用的指令文字。

設定時,這個屬性的值可以使用設計工具自動儲存到資源檔。 如需詳細資訊,請參閱 LocalizableAttribute全球化和當地語系化

適用於

另請參閱