Login 類別

定義

提供使用者介面 (UI) 項目以登入網站。Provides user interface (UI) elements for logging in to a Web site.

public ref class Login : System::Web::UI::WebControls::CompositeControl
[System.ComponentModel.Bindable(false)]
public class Login : System.Web.UI.WebControls.CompositeControl
[<System.ComponentModel.Bindable(false)>]
type Login = class
    inherit CompositeControl
Public Class Login
Inherits CompositeControl
繼承
屬性

範例

下列程式碼範例會使用 Login 控制項來提供用於登入網站的 UI。The following code example uses a Login control to provide a UI for logging in to a Web site.

<%@ Page Language="C#" %>
<%@ Import Namespace="System.ComponentModel" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
bool IsValidEmail(string strIn)
{
    // Return true if strIn is in valid email format.
    return Regex.IsMatch(strIn, @"^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"); 
}

void OnLoggingIn(object sender, System.Web.UI.WebControls.LoginCancelEventArgs e)
{
    if (!IsValidEmail(Login1.UserName))
    {
        Login1.InstructionText = "Enter a valid email address.";
        Login1.InstructionTextStyle.ForeColor = System.Drawing.Color.RosyBrown;
        e.Cancel = true;
    }
    else
    {
        Login1.InstructionText = String.Empty;
    }
}

void OnLoginError(object sender, EventArgs e)
{
    Login1.HelpPageText = "Help with logging in...";
    Login1.PasswordRecoveryText = "Forgot your password?";
}
</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:Login id="Login1" runat="server" 
                BorderStyle="Solid" 
                BackColor="#F7F7DE" 
                BorderWidth="1px"
                BorderColor="#CCCC99" 
                Font-Size="10pt" 
                Font-Names="Verdana" 
                CreateUserText="Create a new user..."
                CreateUserUrl="newUser.aspx" 
                HelpPageUrl="help.aspx"
                PasswordRecoveryUrl="getPass.aspx" 
                UserNameLabelText="Email address:" 
                OnLoggingIn="OnLoggingIn"
                OnLoginError="OnLoginError" >
                <TitleTextStyle Font-Bold="True" 
                    ForeColor="#FFFFFF" 
                    BackColor="#6B696B">
                </TitleTextStyle>
            </asp:Login>

        </form>
    </body>
</html>
<%@ Page Language="VB" %>
<%@ Import Namespace="System.ComponentModel" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
Function IsValidEmail(ByVal strIn As String) As Boolean
    ' Return true if strIn is in valid email format.
    Return Regex.IsMatch(strIn, ("^([\w-\.]+)@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.)|(([\w-]+\.)+))([a-zA-Z]{2,4}|[0-9]{1,3})(\]?)$"))
End Function

Sub OnLoggingIn(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.LoginCancelEventArgs)
    If Not IsValidEmail(Login1.UserName) Then
        Login1.InstructionText = "Enter a valid email address."
        Login1.InstructionTextStyle.ForeColor = System.Drawing.Color.RosyBrown
        e.Cancel = True
    Else
        Login1.InstructionText = String.Empty
    End If
End Sub

Sub OnLoginError(ByVal sender As Object, ByVal e As EventArgs)
    Login1.HelpPageText = "Help with logging in..."
    Login1.PasswordRecoveryText = "Forgot your password?"
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:Login id="Login1" runat="server" 
                BorderStyle="Solid" 
                BackColor="#F7F7DE" 
                BorderWidth="1px"
                BorderColor="#CCCC99" 
                Font-Size="10pt" 
                Font-Names="Verdana" 
                CreateUserText="Create a new user..."
                CreateUserUrl="newUser.aspx" 
                HelpPageUrl="help.aspx"
                PasswordRecoveryUrl="getPass.aspx" 
                UserNameLabelText="Email address:" 
                OnLoggingIn="OnLoggingIn"
                OnLoginError="OnLoginError" >
                <TitleTextStyle Font-Bold="True" 
                    ForeColor="#FFFFFF" 
                    BackColor="#6B696B">
                </TitleTextStyle>
            </asp:Login>

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

下列程式碼範例會示範如何擴充 Login 控制項。The following code example demonstrates how you can extend the Login control. CustomLogin控制項包含 DropDownList 控制項,可讓使用者選擇要使用哪一個成員資格提供者進行驗證。The CustomLogin control includes a DropDownList control that lets users choose which membership provider they are authenticated with. (這些提供者是在 Web.config 中設定。 ) 在 OnLoggingIn 方法中, MembershipProvider 屬性會設為控制項的選取值 DropDownList(These providers are configured in Web.config.) In the OnLoggingIn method, the MembershipProvider property is set to the selected value of the DropDownList control.

重要

此範例包含可接受使用者輸入的文字方塊,這是潛在的安全性威脅。This example contains a text box that accepts user input, which is a potential security threat. 根據預設,ASP.NET Web 網頁會驗證使用者輸入未包含指令碼或 HTML 項目。By default, ASP.NET Web pages validate that user input does not include script or HTML elements. 如需詳細資訊,請參閱 Script Exploits Overview (指令碼攻擊概觀)。For more information, see Script Exploits Overview.

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

namespace Samples.AspNet.Controls
{
    public sealed class CustomLogin : Login
    {
        public CustomLogin() { }
        
        protected override void OnLoggingIn(LoginCancelEventArgs e)
        {
            // Set the Membership provider for the Login control from a DropDownList.
            DropDownList list = (DropDownList)this.FindControl("domain");
            this.MembershipProvider = list.SelectedValue;
            base.OnLoggingIn(e);
        }
        
        protected override void CreateChildControls()
        {
            LayoutTemplate = new MyTemplate();
            base.CreateChildControls();
        }
    }
    
    // A Template that contains the child controls.
    public class MyTemplate : ITemplate
    {
        void ITemplate.InstantiateIn(Control container)
        {
            // A TextBox for the user name.
            TextBox username = new TextBox();
            username.ID = "username";
            
            // A TextBox for the password.
            TextBox password = new TextBox();
            password.ID = "password";
            
            // A CheckBox to remember the user on subsequent visits.
            CheckBox remember = new CheckBox();
            remember.ID = "RememberMe";
            remember.Text = "Don't forget me!";
            
            // Failure Text.
            Literal failure = new Literal();
            failure.ID = "FailureText";
            
            // A DropDownList to choose the Membership provider.
            DropDownList domain = new DropDownList();
            domain.ID = "Domain";
            domain.Items.Add(new ListItem("SqlMembers"));
            domain.Items.Add(new ListItem("SqlMembers2"));
            
            // A Button to log in.
            Button submit = new Button();
            submit.CommandName = "login";
            submit.Text = "LOGIN";

            container.Controls.Add(new LiteralControl("UserName:"));
            container.Controls.Add(username);
            container.Controls.Add(new LiteralControl("<br>Password:"));
            container.Controls.Add(password);
            container.Controls.Add(new LiteralControl("<br>"));
            container.Controls.Add(remember);
            container.Controls.Add(new LiteralControl("<br>Domain:"));
            container.Controls.Add(domain);
            container.Controls.Add(new LiteralControl("<br>"));
            container.Controls.Add(failure);
            container.Controls.Add(new LiteralControl("<br>"));
            container.Controls.Add(submit);
        }
    }    
}
Imports System.Data
Imports System.Configuration
Imports System.Web
Imports System.Web.Security
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.WebControls.WebParts
Imports System.Web.UI.HtmlControls

Namespace Samples.AspNet.Controls

    NotInheritable Public Class CustomLogin
        Inherits Login

        Public Sub New() 
        End Sub

        Protected Overrides Sub OnLoggingIn(ByVal e As LoginCancelEventArgs) 

            ' Set the Membership provider for the Login control from a DropDownList.
            Dim list As DropDownList = CType(Me.FindControl("domain"), DropDownList)
            Me.MembershipProvider = list.SelectedValue
            MyBase.OnLoggingIn(e)

        End Sub


        Protected Overrides Sub CreateChildControls() 

            LayoutTemplate = New MyTemplate()
            MyBase.CreateChildControls()

        End Sub
    End Class

    ' A Template that contains the child controls.
    Public Class MyTemplate
        Implements ITemplate

        Sub InstantiateIn(ByVal container As Control)  Implements ITemplate.InstantiateIn
            ' A TextBox for the user name.
            Dim username As New TextBox()
            username.ID = "username"

            ' A TextBox for the password.
            Dim password As New TextBox()
            password.ID = "password"

            ' A CheckBox to remember the user on subsequent visits.
            Dim remember As New CheckBox()
            remember.ID = "RememberMe"
            remember.Text = "Don't forget me!"

            ' Failure Text.
            Dim failure As New Literal()
            failure.ID = "FailureText"

            ' A DropDownList to choose the Membership provider.
            Dim domain As New DropDownList()
            domain.ID = "Domain"
            domain.Items.Add(New ListItem("SqlMembers"))
            domain.Items.Add(New ListItem("SqlMembers2"))

            ' A Button to log in.
            Dim submit As New Button()
            submit.CommandName = "login"
            submit.Text = "LOGIN"

            container.Controls.Add(New LiteralControl("UserName:"))
            container.Controls.Add(username)
            container.Controls.Add(New LiteralControl("<br>Password:"))
            container.Controls.Add(password)
            container.Controls.Add(New LiteralControl("<br>"))
            container.Controls.Add(remember)
            container.Controls.Add(New LiteralControl("<br>Domain:"))
            container.Controls.Add(domain)
            container.Controls.Add(New LiteralControl("<br>"))
            container.Controls.Add(failure)
            container.Controls.Add(New LiteralControl("<br>"))
            container.Controls.Add(submit)

        End Sub
    End Class
End Namespace

備註

本主題內容:In this topic:

簡介Introduction

Login控制項是複合控制項,可提供在網站上驗證使用者時所需的所有通用 UI 元素。The Login control is a composite control that provides all the common UI elements needed to authenticate a user on a Web site. 所有登入案例都需要下列三個元素:The following three elements are required for all login scenarios:

  • 用來識別使用者的唯一使用者名稱。A unique user name to identify the user.

  • 用來驗證使用者身分識別的密碼。A password to verify the identity of the user.

  • 用來將登入資訊傳送至伺服器的登入按鈕。A login button to send the login information to the server.

Login控制項也提供下列支援其他函數的選擇性 UI 元素:The Login control also provides the following optional UI elements that support additional functions:

  • 密碼提醒的連結。A link for a password reminder.

  • 在會話之間保留登入資訊時,請記住我的核取方塊。A Remember Me checkbox for retaining the login information between sessions.

  • 登入時發生問題之使用者的說明連結。A Help link for users who are having trouble logging in.

  • [註冊新的使用者] 連結,可將使用者重新導向至註冊頁面。A Register New User link that redirects users to a registration page.

  • 出現在登入表單上的指示文字。Instruction text that appears on the login form.

  • 當使用者按一下 [登入] 按鈕而未填入 [使用者名稱] 或 [密碼] 欄位時,所顯示的自訂錯誤文字。Custom error text that appears when the user clicks the login button without filling in the user name or password fields.

  • 登入失敗時所顯示的自訂錯誤文字。Custom error text that appears if the login fails.

  • 登入成功時所發生的自訂動作。A custom action that occurs when login succeeds.

  • 當使用者已經登入網站時,隱藏登入控制項的方法。A way to hide the login control if the user is already logged in to the site.

如需顯示需要哪些控制項且為選擇性的資料表,請參閱 LayoutTemplate 屬性。For a table showing which controls are required and which are optional, see LayoutTemplate property.

注意

如果您不熟悉 ASP.NET 中可用的登入控制項集合,請參閱 ASP.NET 登入控制項總覽 ,再繼續進行。If you are not familiar with the set of login controls available in ASP.NET, see ASP.NET Login Controls Overview before continuing. 如需與登入控制項和成員資格相關的其他主題清單,請參閱 使用成員資格來管理使用者For a list of other topics related to login controls and membership, see Managing Users by Using Membership.

重要

接受使用者輸入是潛在的安全性威脅。Accepting user input is a potential security threat. 惡意使用者可以傳送旨在公開弱點的資料,或執行嘗試產生密碼的程式。Malicious users can send data that is intended to expose vulnerabilities or run programs that try generated passwords. 若要在使用使用者輸入時改善安全性,您應該使用控制項的驗證功能,並保護為您的控制項設定的任何資料提供者。To improve security when working with user input, you should use the validation features of your control and secure any data providers that are configured for your control. 如需詳細資訊,請參閱 保護登入控制項Web 應用程式的基本安全性作法保護成員資格For more information, see Securing Login Controls, Basic Security Practices for Web Applications, and Securing Membership.

Login控制項使用成員資格提供者來取得使用者認證。The Login control uses a membership provider to obtain user credentials. 除非您另外指定,否則 Login 控制項會使用 Web.config 檔中定義的預設成員資格提供者。Unless you specify otherwise, the Login control uses the default membership provider defined in the Web.config file. 若要指定不同的提供者,請將 MembershipProvider 屬性設定為在應用程式的 Web.config 檔中定義的其中一個成員資格提供者名稱。To specify a different provider, set the MembershipProvider property to one of the membership provider names defined in your application's Web.config file. 如需詳細資訊,請參閱 成員資格提供者For more information, see Membership Providers.

如果您想要使用自訂驗證服務,您可以使用 OnAuthenticate 方法來呼叫服務。If you want to use a custom authentication service, you can use the OnAuthenticate method to call the service.

樣式和範本Styles and Templates

控制項的外觀可 Login 透過範本和樣式設定完全自訂。The appearance of the Login control is fully customizable through templates and style settings. 所有 UI 文字訊息也可以透過類別的屬性自訂 LoginAll UI text messages are also customizable through properties of the Login class. 預設的介面文字會根據伺服器上的地區設定自動當地語系化。The default interface text is automatically localized based on the locale setting on the server.

如果 Login 控制項是使用範本自訂,則 AccessKey 會忽略屬性和 TabIndex 屬性。If the Login control is customized with templates, then the AccessKey property and the TabIndex property are ignored. 在此情況下,請 AccessKey TabIndex 直接設定每個範本子控制項的屬性和屬性。In this case, set the AccessKey property and the TabIndex property of each template child control directly.

Login 文字方塊所代表的控制項屬性(例如 UserNamePassword )可在頁面生命週期的所有階段中存取。Login control properties represented by text boxes, such as UserName and Password, are accessible during all phases of the page life cycle. 控制項會透過文字方塊所觸發的事件,來挑選使用者所做的任何變更 TextChangedThe control will pick up any changes made by the end user by means of the TextChanged event triggered by the textboxes.

注意

如果您將 Login 控制項內嵌在 WizardStep 物件中,請在使用者已驗證時,明確設定 ActiveStepIndex Page_Load 事件處理常式中的屬性。If you embed the Login control in a WizardStep object, explicitly set the ActiveStepIndex property in a Page_Load event handler if the user is authenticated. Wizard在此案例中,控制項不會自動前進到下一個 WizardStep 物件。The Wizard control does not automatically advance to the next WizardStep object in this scenario.

下表列出 Login 控制項樣式屬性,並說明每個樣式屬性會影響哪個 UI 元素。The following table lists the Login control style properties and explains which UI element each style property affects. 如需每個樣式適用的屬性清單,請參閱個別樣式屬性的檔。For a list of which properties each style applies to, see the documentation for the individual style properties.

Style 屬性Style property 受影響的 UI 元素UI element affected
BorderPadding 控制項內容和控制項框線之間的間距。The space between the control contents and the control's border.
CheckBoxStyle [記住我] 核取方塊。Remember Me checkbox.
FailureTextStyle 登入失敗文字。Login failure text.
InstructionTextStyle 頁面上的解說文字,告訴使用者如何使用控制項。Instructional text on the page that tells users how to use the control.
LabelStyle 所有輸入欄位的標籤,例如文字方塊。Labels for all input fields, such as text boxes.
TextBoxStyle 文字輸入輸入欄位。Text entry input fields.
TitleTextStyle 標題文字。Title text.
ValidatorTextStyle 當登入嘗試因為驗證錯誤而失敗時,顯示給使用者的文字。Text displayed to the user when a login attempt is unsuccessful due to validation errors.
HyperLinkStyle 其他頁面的連結。Links to other pages.
LoginButtonStyle 登入按鈕。Login button.

驗證分組Validation Groupings

UserNamePassword 屬性有 RequiredFieldValidator 相關聯的控制項,可防止使用者在未提供必要資訊的情況下提交頁面。The UserName and Password properties have RequiredFieldValidator controls associated with them to prevent users from submitting the page without providing required information.

Login控制項使用驗證群組,以便在與控制項相同頁面上的其他欄位 Login 可以單獨進行驗證。The Login control uses a validation group so that other fields on the same page as the Login control can be validated separately. 根據預設, ID 控制項的屬性 Login 會用來做為驗證群組的名稱。By default, the ID property of the Login control is used as the name of the validation group. 例如,識別碼為 Login "Login1" 的控制項將使用 "Login1" 的驗證組名。For example, a Login control with the ID "Login1" will use a validation group name of "Login1". 如果您想要設定控制項所屬的驗證群組 Login ,您必須將控制項範本,並變更驗證組名。If you want to set the validation group that the Login control is part of, you must template the control and change the validation group name.

套用 CSS 樣式Applying CSS Styles

Login控制項可讓您在標記中指定 CSS 樣式規則。The Login control lets you specify CSS style rules in markup. 如果您使用範本來自訂控制項的外觀 Login ,您可以在範本的標記中指定 CSS 樣式。If you use templates to customize the appearance of the Login control, you can specify CSS styles in the markup in the templates. 在這種情況下,不需要額外的外部資料表。In that case, no extra outer table is required. 您可以藉由將屬性設定為,來防止轉譯資料表 RenderOuterTable falseYou can prevent the table from being rendered by setting the RenderOuterTable property to false.

協助工具選項Accessibility

如需如何設定此控制項,使其產生符合協助工具標準之標記的詳細資訊,請參閱 Visual Studio 和 ASP.NETASP.NET 控制項和協助工具中的協助工具。For information about how to configure this control so that it generates markup that conforms to accessibility standards, see Accessibility in Visual Studio and ASP.NET and ASP.NET Controls and Accessibility.

宣告式語法Declarative Syntax

<asp:Login
    AccessKey="string"
    BackColor="color name|#dddddd"
    BorderColor="color name|#dddddd"
    BorderPadding="integer"
    BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge|
        Inset|Outset"
    BorderWidth="size"
    CreateUserIconUrl="uri"
    CreateUserText="string"
    CreateUserUrl="uri"
    CssClass="string"
    DestinationPageUrl="uri"
    DisplayRememberMe="True|False"
    Enabled="True|False"
    EnableTheming="True|False"
    EnableViewState="True|False"
    FailureAction="Refresh|RedirectToLoginPage"
    FailureText="string"
    Font-Bold="True|False"
    Font-Italic="True|False"
    Font-Names="string"
    Font-Overline="True|False"
    Font-Size="string|Smaller|Larger|XX-Small|X-Small|Small|Medium|
               Large|X-Large|XX-Large"
    Font-Strikeout="True|False"
    Font-Underline="True|False"
    ForeColor="color name|#dddddd"
    Height="size"
    HelpPageIconUrl="uri"
    HelpPageText="string"
    HelpPageUrl="uri"
    ID="string"
    InstructionText="string"
    LoginButtonImageUrl="uri"
    LoginButtonText="string"
    LoginButtonType="Button|Image|Link"
    MembershipProvider="string"
    OnAuthenticate="Authenticate event handler"
    OnDataBinding="DataBinding event handler"
    OnDisposed="Disposed event handler"
    OnInit="Init event handler"
    OnLoad="Load event handler"
    OnLoggedIn="LoggedIn event handler"
    OnLoggingIn="LoggingIn event handler"
    OnLoginError="LoginError event handler"
    OnPreRender="PreRender event handler"
    OnUnload="Unload event handler"
    Orientation="Horizontal|Vertical"
    PasswordLabelText="string"
    PasswordRecoveryIconUrl="uri"
    PasswordRecoveryText="string"
    PasswordRecoveryUrl="uri"
    PasswordRequiredErrorMessage="string"
    RememberMeSet="True|False"
    RememberMeText="string"
    runat="server"
    SkinID="string"
    Style="string"
    TabIndex="integer"
    TextLayout="TextOnLeft|TextOnTop"
    TitleText="string"
    ToolTip="string"
    UserName="string"
    UserNameLabelText="string"
    UserNameRequiredErrorMessage="string"
    Visible="True|False"
    VisibleWhenLoggedIn="True|False"
    Width="size"
>
        <CheckBoxStyle />
        <FailureTextStyle />
        <HyperLinkStyle />
        <InstructionTextStyle />
        <LabelStyle />
        <LayoutTemplate>
            <!-- child controls -->
        </LayoutTemplate>
        <LoginButtonStyle />
        <TextBoxStyle />
        <TitleTextStyle />
        <ValidatorTextStyle />
</asp:Login>

建構函式

Login()

建立 Login 控制項的新執行個體。Creates a new instance of the Login control.

欄位

LoginButtonCommandName

表示與登入按鈕關聯的命令名稱。Represents the command name associated with the login button.

屬性

AccessKey

取得或設定便捷鍵 (Access Key),可讓您快速巡覽至 Web 伺服器控制項。Gets or sets the access key that allows you to quickly navigate to the Web server control.

(繼承來源 WebControl)
Adapter

針對控制項取得瀏覽器的特定配置器。Gets the browser-specific adapter for the control.

(繼承來源 Control)
AppRelativeTemplateSourceDirectory

取得或設定包含了此控制項之 PageUserControl 物件的相對應用程式虛擬目錄。Gets or sets the application-relative virtual directory of the Page or UserControl object that contains this control.

(繼承來源 Control)
Attributes

取得任意屬性 (Attribute) 的集合 (只供呈現),不與控制項上的屬性 (Property) 對應。Gets the collection of arbitrary attributes (for rendering only) that do not correspond to properties on the control.

(繼承來源 WebControl)
BackColor

取得或設定 Web 伺服器控制項的背景色彩。Gets or sets the background color of the Web server control.

(繼承來源 WebControl)
BindingContainer

取得包含了此控制項之資料繫結的控制項。Gets the control that contains this control's data binding.

(繼承來源 Control)
BorderColor

取得或設定 Web 控制項的框線色彩。Gets or sets the border color of the Web control.

(繼承來源 WebControl)
BorderPadding

取得或設定 Login 控制項之框線內部的填補量。Gets or sets the amount of padding inside the borders of the Login control.

BorderStyle

取得或設定 Web 伺服器控制項的框線樣式。Gets or sets the border style of the Web server control.

(繼承來源 WebControl)
BorderWidth

取得或設定 Web 伺服器控制項的框線寬度。Gets or sets the border width of the Web server control.

(繼承來源 WebControl)
CheckBoxStyle

取得 Style 物件的參考,其定義了 [儲存我的資訊] 核取方塊的設定。Gets a reference to a Style object that defines the settings for the Remember Me check box.

ChildControlsCreated

取得值,指出是否已經建立伺服器控制項的子控制項。Gets a value that indicates whether the server control's child controls have been created.

(繼承來源 Control)
ClientID

取得 ASP.NET 所產生之 HTML 標記的控制項識別碼。Gets the control ID for HTML markup that is generated by ASP.NET.

(繼承來源 Control)
ClientIDMode

取得或設定用來產生 ClientID 屬性值的演算法。Gets or sets the algorithm that is used to generate the value of the ClientID property.

(繼承來源 Control)
ClientIDSeparator

取得字元值,表示在 ClientID 屬性中所使用的分隔字元。Gets a character value representing the separator character used in the ClientID property.

(繼承來源 Control)
Context

取得與目前 Web 要求的伺服器控制項關聯的 HttpContext 物件。Gets the HttpContext object associated with the server control for the current Web request.

(繼承來源 Control)
Controls

取得表示 ControlCollection 中之子控制項的 CompositeControl 物件。Gets a ControlCollection object that represents the child controls in a CompositeControl.

(繼承來源 CompositeControl)
ControlStyle

取得 Web 伺服器控制項的樣式。Gets the style of the Web server control. 這個屬性主要由控制項開發人員使用。This property is used primarily by control developers.

(繼承來源 WebControl)
ControlStyleCreated

取得值,指出 Style 物件是否已經為 ControlStyle 屬性建立。Gets a value indicating whether a Style object has been created for the ControlStyle property. 這個屬性主要由控制項開發人員使用。This property is primarily used by control developers.

(繼承來源 WebControl)
CreateUserIconUrl

取得顯示在新使用者註冊頁面的連結旁邊之影像的位置。Gets the location of an image to display next to the link to a registration page for new users.

CreateUserText

取得或設定新使用者註冊頁面之連結的文字。Gets or sets the text of a link to a registration page for new users.

CreateUserUrl

取得或設定新使用者註冊頁面的 URL。Gets or sets the URL of the new-user registration page.

CssClass

取得或設定用戶端上 Web 伺服器控制項所呈現的階層式樣式表 (CSS)。Gets or sets the Cascading Style Sheet (CSS) class rendered by the Web server control on the client.

(繼承來源 WebControl)
DataItemContainer

如果命名容器實作 IDataItemContainer,則取得命名容器的參考。Gets a reference to the naming container if the naming container implements IDataItemContainer.

(繼承來源 Control)
DataKeysContainer

如果命名容器實作 IDataKeysControl,則取得命名容器的參考。Gets a reference to the naming container if the naming container implements IDataKeysControl.

(繼承來源 Control)
DesignMode

取得值,指出控制項是否正用於設計介面上。Gets a value indicating whether a control is being used on a design surface.

(繼承來源 Control)
DestinationPageUrl

取得或設定在登入嘗試成功時顯示給使用者之頁面的 URL。Gets or sets the URL of the page displayed to the user when a login attempt is successful.

DisplayRememberMe

取得或設定值,表示是否顯示核取方塊,讓使用者控制是否將永續性 Cookie 傳送至瀏覽器。Gets or sets a value indicating whether to display a check box to enable the user to control whether a persistent cookie is sent to their browser.

Enabled

取得或設定值,指出 Web 伺服器控制項是否啟用。Gets or sets a value indicating whether the Web server control is enabled.

(繼承來源 WebControl)
EnableTheming

取得或設定值,指出佈景主題是否套用至此控制項。Gets or sets a value indicating whether themes apply to this control.

(繼承來源 WebControl)
EnableViewState

取得或設定值,該值表示伺服器控制項是否對要求的用戶端而言保持其檢視狀態,以及它包含的任何子控制項狀態。Gets or sets a value indicating whether the server control persists its view state, and the view state of any child controls it contains, to the requesting client.

(繼承來源 Control)
Events

取得控制項事件處理常式委派 (Delegate) 的清單。Gets a list of event handler delegates for the control. 這個屬性是唯讀的。This property is read-only.

(繼承來源 Control)
FailureAction

取得或設定登入嘗試失敗時發生的動作。Gets or sets the action that occurs when a login attempt fails.

FailureText

取得或設定登入嘗試失敗時顯示的文字。Gets or sets the text displayed when a login attempt fails.

FailureTextStyle

取得定義 Login 控制項中錯誤文字外觀之屬性集合的參考。Gets a reference to a collection of properties that define the appearance of error text in the Login control.

Font

取得與 Web 伺服器控制項關聯的字型屬性。Gets the font properties associated with the Web server control.

(繼承來源 WebControl)
ForeColor

取得或設定 Web 伺服器控制項的前景色彩 (通常是文字的色彩)。Gets or sets the foreground color (typically the color of the text) of the Web server control.

(繼承來源 WebControl)
HasAttributes

取得值,指出控制項是否已經設定屬性。Gets a value indicating whether the control has attributes set.

(繼承來源 WebControl)
HasChildViewState

取得值,指出目前伺服器控制項的子控制項是否有任何已儲存的檢視狀態設定。Gets a value indicating whether the current server control's child controls have any saved view-state settings.

(繼承來源 Control)
Height

取得或設定 Web 伺服器控制項的高度。Gets or sets the height of the Web server control.

(繼承來源 WebControl)
HelpPageIconUrl

取得顯示在登入 [說明] 頁面連結旁邊之映像的位置。Gets the location of an image to display next to the link to the login Help page.

HelpPageText

取得或設定登入 [說明] 頁面之連結的文字。Gets or sets the text of a link to the login Help page.

HelpPageUrl

取得或設定登入 [說明] 頁面的 URL。Gets or sets the URL of the login Help page.

HyperLinkStyle

取得定義 Login 控制項中超連結 (Hyperlink) 外觀之屬性集合的參考。Gets a reference to a collection of properties that define the appearance of hyperlinks in the Login control.

ID

取得或設定指派給伺服器控制項的程式設計識別項。Gets or sets the programmatic identifier assigned to the server control.

(繼承來源 Control)
IdSeparator

取得用來分隔控制項識別項的字元。Gets the character used to separate control identifiers.

(繼承來源 Control)
InstructionText

取得或設定使用者的登入指示文字。Gets or sets login instruction text for the user.

InstructionTextStyle

取得 TableItemStyle 物件的參考,其定義了 Login 控制項中指示文字的設定。Gets a reference to a TableItemStyle object that defines the settings for instruction text in the Login control.

IsChildControlStateCleared

取得值,指出這個控制項中所包含的控制項是否有控制項狀態。Gets a value indicating whether controls contained within this control have control state.

(繼承來源 Control)
IsEnabled

取得值,指出是否啟用控制項。Gets a value indicating whether the control is enabled.

(繼承來源 WebControl)
IsTrackingViewState

取得值,指出伺服器控制項是否正在儲存檢視狀態的變更。Gets a value that indicates whether the server control is saving changes to its view state.

(繼承來源 Control)
IsViewStateEnabled

取得值,指出這個控制項是否已啟用檢視狀態。Gets a value indicating whether view state is enabled for this control.

(繼承來源 Control)
LabelStyle

取得 TableItemStyle 物件的參考,其定義了 Login 控制項標籤的設定。Gets a reference to a TableItemStyle object that defines the settings for Login control labels.

LayoutTemplate

取得或設定用於顯示 Login 控制項的樣板。Gets or sets the template used to display the Login control.

LoadViewStateByID

取得值,指出控制項是否依 ID (而不是索引) 參與載入其檢視狀態。Gets a value indicating whether the control participates in loading its view state by ID instead of index.

(繼承來源 Control)
LoginButtonImageUrl

取得或設定要用於登入按鈕之影像的 URL。Gets or sets the URL of an image to use for the login button.

LoginButtonStyle

取得 Style 物件的參考,其可讓您設定 Login 控制項中登入按鈕的外觀。Gets a reference to the Style object that allows you to set the appearance of the login button in the Login control.

LoginButtonText

取得或設定 Login 控制項之登入按鈕的文字。Gets or sets the text for the Login control's login button.

LoginButtonType

取得或設定呈現 Login 按鈕時需要使用的按鈕類型。Gets or sets the type of button to use when rendering the Login button.

MembershipProvider

取得或設定控制項所使用之成員資格資料提供者的名稱。Gets or sets the name of the membership data provider used by the control.

NamingContainer

取得伺服器控制項命名容器的參考,其建立唯一命名空間,在具有相同 ID 屬性值的伺服器控制項之間作區別。Gets a reference to the server control's naming container, which creates a unique namespace for differentiating between server controls with the same ID property value.

(繼承來源 Control)
Orientation

取得或設定值,指定 Login 控制項之項目在頁面上的位置。Gets or sets a value that specifies the position of the elements of the Login control on the page.

Page

取得含有伺服器控制項的 Page 執行個體的參考。Gets a reference to the Page instance that contains the server control.

(繼承來源 Control)
Parent

在網頁控制階層架構中取得伺服器控制項之父控制項的參考。Gets a reference to the server control's parent control in the page control hierarchy.

(繼承來源 Control)
Password

取得使用者輸入的密碼。Gets the password entered by the user.

PasswordLabelText

取得或設定 Password 文字方塊的標籤文字。Gets or sets the text of the label for the Password text box.

PasswordRecoveryIconUrl

取得顯示在密碼復原頁面的連結旁邊之影像的位置。Gets the location of an image to display next to the link to the password recovery page.

PasswordRecoveryText

取得或設定密碼復原頁面之連結的文字。Gets or sets the text of a link to the password recovery page.

PasswordRecoveryUrl

取得或設定密碼復原頁面的 URL。Gets or sets the URL of the password recovery page.

PasswordRequiredErrorMessage

取得或設定錯誤訊息,其在密碼欄位保留為空白時顯示於 ValidationSummary 控制項中。Gets or sets the error message to display in a ValidationSummary control when the password field is left blank.

RememberMeSet

取得或設定值,指示是否將永續性驗證 Cookie 傳送至使用者的瀏覽器。Gets or sets a value indicating whether to send a persistent authentication cookie to the user's browser.

RememberMeText

取得或設定 [儲存我的資訊] 核取方塊之標籤的文字。Gets or sets the text of the label for the Remember Me check box.

RenderingCompatibility

取得值,這個值會指定將與呈現 HTML 相容的 ASP.NET 版本。Gets a value that specifies the ASP.NET version that rendered HTML will be compatible with.

(繼承來源 Control)
RenderOuterTable

取得或設定值,這個值指出控制項是否會將轉譯的 HTML 放置在 table 項目內,以便套用內嵌樣式。Gets or sets a value that indicates whether the control encloses rendered HTML in a table element in order to apply inline styles.

Site

當呈現在設計介面上時,取得裝載目前控制項之容器的資訊。Gets information about the container that hosts the current control when rendered on a design surface.

(繼承來源 Control)
SkinID

取得或設定要套用至控制項的面板。Gets or sets the skin to apply to the control.

(繼承來源 WebControl)
Style

取得文字屬性的集合,將呈現為 Web 伺服器控制項的外部標記上的樣式屬性。Gets a collection of text attributes that will be rendered as a style attribute on the outer tag of the Web server control.

(繼承來源 WebControl)
SupportsDisabledAttribute

取得值,這個值表示當控制項的 disabled 屬性為 IsEnabled 時,控制項是否應該將呈現之 HTML 項目的 false 屬性設為 "disabled"。Gets a value that indicates whether the control should set the disabled attribute of the rendered HTML element to "disabled" when the control's IsEnabled property is false.

(繼承來源 CompositeControl)
TabIndex

取得或設定 Web 伺服器控制項的定位索引。Gets or sets the tab index of the Web server control.

(繼承來源 WebControl)
TagKey

取得對應於 HtmlTextWriterTag 控制項的 Login 值。Gets the HtmlTextWriterTag value that corresponds to a Login control. 這個屬性主要由控制項開發人員使用。This property is used primarily by control developers.

TagName

取得控制項標記的名稱。Gets the name of the control tag. 這個屬性主要由控制項開發人員使用。This property is used primarily by control developers.

(繼承來源 WebControl)
TemplateControl

取得或設定包含了此控制項之樣板的參考。Gets or sets a reference to the template that contains this control.

(繼承來源 Control)
TemplateSourceDirectory

取得包含目前伺服器控制項的 PageUserControl 的虛擬目錄。Gets the virtual directory of the Page or UserControl that contains the current server control.

(繼承來源 Control)
TextBoxStyle

取得定義 Login 控制項中文字方塊外觀之屬性集合的參考。Gets a reference to a collection of properties that define the appearance of text boxes in the Login control.

TextLayout

指定每個標籤的位置 (相對於其所關聯之 Login 控制項的文字方塊)。Specifies the position of each label relative to its associated text box for the Login control.

TitleText

取得或設定 Login 控制項的標題。Gets or sets the title of the Login control.

TitleTextStyle

取得定義 Login 控制項中標題文字外觀之屬性集合的參考。Gets a reference to a collection of properties that define the appearance of the title text in the Login control.

ToolTip

取得或設定當滑鼠指標停留在 Web 伺服器控制項時顯示的文字。Gets or sets the text displayed when the mouse pointer hovers over the Web server control.

(繼承來源 WebControl)
UniqueID

取得伺服器控制項唯一的、符合階層架構的識別項。Gets the unique, hierarchically qualified identifier for the server control.

(繼承來源 Control)
UserName

取得使用者輸入的使用者名稱。Gets the user name entered by the user.

UserNameLabelText

取得或設定 UserName 文字方塊的標籤文字。Gets or sets the text of the label for the UserName text box.

UserNameRequiredErrorMessage

取得或設定錯誤訊息,其在使用者名稱欄位保留為空白時顯示於 ValidationSummary 控制項中。Gets or sets the error message to display in a ValidationSummary control when the user name field is left blank.

ValidateRequestMode

取得或設定值,指出控制項是否對來自瀏覽器的用戶端輸入檢查潛在的危險值。Gets or sets a value that indicates whether the control checks client input from the browser for potentially dangerous values.

(繼承來源 Control)
ValidatorTextStyle

取得定義錯誤訊息外觀之 Style 屬性集合的參考,該錯誤訊息與 Login 控制項使用的驗證器相關聯。Gets a reference to a collection of Style properties that define the appearance of error messages associated with validators used by the Login control.

ViewState

取得狀態資訊的字典,允許您在相同網頁的多個要求之間,儲存和還原伺服器控制項的檢視狀態。Gets a dictionary of state information that allows you to save and restore the view state of a server control across multiple requests for the same page.

(繼承來源 Control)
ViewStateIgnoresCase

取得值,指出 StateBag 物件是否不區分大小寫。Gets a value that indicates whether the StateBag object is case-insensitive.

(繼承來源 Control)
ViewStateMode

取得或設定這個控制項的檢視狀態模式。Gets or sets the view-state mode of this control.

(繼承來源 Control)
Visible

取得或設定值,指出伺服器控制項是否會轉譯為頁面上的 UI。Gets or sets a value that indicates whether a server control is rendered as UI on the page.

(繼承來源 Control)
VisibleWhenLoggedIn

取得或設定值,指示在驗證使用者之後是否要顯示 Login 控制項。Gets or sets a value indicating whether to show the Login control after the user is authenticated.

Width

取得或設定 Web 伺服器控制項的寬度。Gets or sets the width of the Web server control.

(繼承來源 WebControl)

方法

AddAttributesToRender(HtmlTextWriter)

將需要呈現的 HTML 屬性和樣式加入至指定的 HtmlTextWriterTag 中。Adds HTML attributes and styles that need to be rendered to the specified HtmlTextWriterTag. 這個方法主要由控制項開發人員使用。This method is used primarily by control developers.

(繼承來源 WebControl)
AddedControl(Control, Int32)

在子控制項加入 Control 物件的 Controls 集合後呼叫。Called after a child control is added to the Controls collection of the Control object.

(繼承來源 Control)
AddParsedSubObject(Object)

通知伺服器控制項,XML 或 HTML 項目已剖析,並將項目加入伺服器控制項的 ControlCollection 物件中。Notifies the server control that an element, either XML or HTML, was parsed, and adds the element to the server control's ControlCollection object.

(繼承來源 Control)
ApplyStyle(Style)

將指定樣式的任何非空白項目加入到 Web 控制項中,覆寫控制項的任何現有的樣式項目。Copies any nonblank elements of the specified style to the Web control, overwriting any existing style elements of the control. 這個方法主要由控制項開發人員使用。This method is primarily used by control developers.

(繼承來源 WebControl)
ApplyStyleSheetSkin(Page)

將頁面樣式表中所定義的樣式屬性套用至控制項。Applies the style properties defined in the page style sheet to the control.

(繼承來源 Control)
BeginRenderTracing(TextWriter, Object)

開始進行轉譯資料的設計階段追蹤。Begins design-time tracing of rendering data.

(繼承來源 Control)
BuildProfileTree(String, Boolean)

收集伺服器控制項的相關資訊,並在頁面啟用追蹤時將此資訊傳遞至 Trace 屬性以顯示之。Gathers information about the server control and delivers it to the Trace property to be displayed when tracing is enabled for the page.

(繼承來源 Control)
ClearCachedClientID()

將快取的 ClientID 值設定為 nullSets the cached ClientID value to null.

(繼承來源 Control)
ClearChildControlState()

刪除伺服器控制項之子控制項的控制項狀態資訊。Deletes the control-state information for the server control's child controls.

(繼承來源 Control)
ClearChildState()

刪除所有伺服器控制項之子控制項的檢視狀態和控制項狀態資訊。Deletes the view-state and control-state information for all the server control's child controls.

(繼承來源 Control)
ClearChildViewState()

刪除所有伺服器控制項之子控制項的檢視狀態資訊。Deletes the view-state information for all the server control's child controls.

(繼承來源 Control)
ClearEffectiveClientIDMode()

將目前的控制項執行個體和任何子控制項的 ClientIDMode 屬性設定為 InheritSets the ClientIDMode property of the current control instance and of any child controls to Inherit.

(繼承來源 Control)
CopyBaseAttributes(WebControl)

將不被 Style 物件封裝的屬性從指定的 Web 伺服器控制項複製到呼叫這個方法的 Web 伺服器控制項上。Copies the properties not encapsulated by the Style object from the specified Web server control to the Web server control that this method is called from. 這個方法主要由控制項開發人員使用。This method is used primarily by control developers.

(繼承來源 WebControl)
CreateChildControls()

建立組成 Login 控制項的個別控制項,以及將事件處理常式與其事件相關聯。Creates the individual controls that make up the Login control and associates event handlers with their events.

CreateControlCollection()

建立新的 ControlCollection 物件來保存伺服器控制項的子控制項 (常值和伺服器)。Creates a new ControlCollection object to hold the child controls (both literal and server) of the server control.

(繼承來源 Control)
CreateControlStyle()

建立樣式物件,這個物件被 WebControl 類別內部使用,以實作所有的樣式相關屬性。Creates the style object that is used internally by the WebControl class to implement all style related properties. 這個方法主要由控制項開發人員使用。This method is used primarily by control developers.

(繼承來源 WebControl)
DataBind()

繫結資料來源至 CompositeControl 以及其所有子控制項。Binds a data source to the CompositeControl and all its child controls.

(繼承來源 CompositeControl)
DataBind(Boolean)

使用會引發 DataBinding 事件的選項,繫結資料來源至叫用的伺服器控制項及其所有子控制項。Binds a data source to the invoked server control and all its child controls with an option to raise the DataBinding event.

(繼承來源 Control)
DataBindChildren()

繫結資料來源至伺服器控制項的子控制項。Binds a data source to the server control's child controls.

(繼承來源 Control)
Dispose()

啟用伺服器控制項,在它從記憶體釋放之前執行最後清除。Enables a server control to perform final clean up before it is released from memory.

(繼承來源 Control)
EndRenderTracing(TextWriter, Object)

結束轉譯資料的設計階段追蹤。Ends design-time tracing of rendering data.

(繼承來源 Control)
EnsureChildControls()

判斷伺服器控制項是否包含子控制項。Determines whether the server control contains child controls. 如果不包含,則建立子控制項。If it does not, it creates child controls.

(繼承來源 Control)
EnsureID()

為尚未指定識別項的控制項,建立識別項。Creates an identifier for controls that do not have an identifier assigned.

(繼承來源 Control)
Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
FindControl(String)

在目前命名容器搜尋具有指定 id 參數的伺服器控制項。Searches the current naming container for a server control with the specified id parameter.

(繼承來源 Control)
FindControl(String, Int32)

使用指定的 id 和有助於搜尋之 pathOffset 參數中所指定的整數,在目前的命名容器中搜尋伺服器控制項。Searches the current naming container for a server control with the specified id and an integer, specified in the pathOffset parameter, which aids in the search. 您不應該覆寫這個版本的 FindControl 方法。You should not override this version of the FindControl method.

(繼承來源 Control)
Focus()

設定控制項的輸入焦點。Sets input focus to a control.

(繼承來源 Control)
GetDesignModeState()

取得控制項的設計階段資料。Gets design-time data for a control.

(繼承來源 Control)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetRouteUrl(Object)

取得會對應於一組路由參數的 URL。Gets the URL that corresponds to a set of route parameters.

(繼承來源 Control)
GetRouteUrl(RouteValueDictionary)

取得會對應於一組路由參數的 URL。Gets the URL that corresponds to a set of route parameters.

(繼承來源 Control)
GetRouteUrl(String, Object)

取得 URL,此 URL 對應於一組路由參數及一個路由名稱。Gets the URL that corresponds to a set of route parameters and a route name.

(繼承來源 Control)
GetRouteUrl(String, RouteValueDictionary)

取得 URL,此 URL 對應於一組路由參數及一個路由名稱。Gets the URL that corresponds to a set of route parameters and a route name.

(繼承來源 Control)
GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
GetUniqueIDRelativeTo(Control)

傳回指定之控制項 UniqueID 屬性的前置部分。Returns the prefixed portion of the UniqueID property of the specified control.

(繼承來源 Control)
HasControls()

判斷伺服器控制項是否包含任何子控制項。Determines if the server control contains any child controls.

(繼承來源 Control)
HasEvents()

傳回值,指出控制項或任何子控制項的事件是否已註冊。Returns a value indicating whether events are registered for the control or any child controls.

(繼承來源 Control)
IsLiteralContent()

判斷伺服器控制項是否只儲存常值內容。Determines if the server control holds only literal content.

(繼承來源 Control)
LoadControlState(Object)

SaveControlState() 方法所儲存的上一頁要求中,還原控制項狀態資訊。Restores control-state information from a previous page request that was saved by the SaveControlState() method.

(繼承來源 Control)
LoadViewState(Object)

從上一個使用 SaveViewState() 方法儲存的要求中,還原檢視狀態資訊。Restores view-state information from a previous request that was saved with the SaveViewState() method.

MapPathSecure(String)

擷取虛擬絕對路徑或相對路徑所對應至的實體路徑。Retrieves the physical path that a virtual path, either absolute or relative, maps to.

(繼承來源 Control)
MemberwiseClone()

建立目前 Object 的淺層複製。Creates a shallow copy of the current Object.

(繼承來源 Object)
MergeStyle(Style)

將指定樣式的任何非空白項目複製到 Web 控制項,但不覆寫控制項的任何現有樣式項目。Copies any nonblank elements of the specified style to the Web control, but will not overwrite any existing style elements of the control. 這個方法主要由控制項開發人員使用。This method is used primarily by control developers.

(繼承來源 WebControl)
OnAuthenticate(AuthenticateEventArgs)

引發 Authenticate 事件來驗證使用者。Raises the Authenticate event to authenticate the user.

OnBubbleEvent(Object, EventArgs)

判斷是否將事件在頁面的使用者介面 (UI) 伺服器控制項階層架構上向上傳遞。Determines whether to pass an event up the page's user interface (UI) server control hierarchy.

OnDataBinding(EventArgs)

引發 DataBinding 事件。Raises the DataBinding event.

(繼承來源 Control)
OnInit(EventArgs)

引發 Init 事件。Raises the Init event.

(繼承來源 Control)
OnLoad(EventArgs)

引發 Load 事件。Raises the Load event.

(繼承來源 Control)
OnLoggedIn(EventArgs)

使用者登入網站且已經過驗證時會引發 LoggedIn 事件。Raises the LoggedIn event after the user logs in to the Web site and has been authenticated.

OnLoggingIn(LoginCancelEventArgs)

在使用者送出登入資訊之後,但在進行驗證之前,會引發 LoggingIn 事件。Raises the LoggingIn event when a user submits login information but before the authentication takes place.

OnLoginError(EventArgs)

登入嘗試失敗時,會引發 LoginError 事件。Raises the LoginError event when a login attempt fails.

OnPreRender(EventArgs)

實作基底 OnPreRender(EventArgs) 方法。Implements the base OnPreRender(EventArgs) method.

OnUnload(EventArgs)

引發 Unload 事件。Raises the Unload event.

(繼承來源 Control)
OpenFile(String)

取得用來讀取檔案的 StreamGets a Stream used to read a file.

(繼承來源 Control)
RaiseBubbleEvent(Object, EventArgs)

指派事件的任何來源和它的資訊至控制項的父控制項。Assigns any sources of the event and its information to the control's parent.

(繼承來源 Control)
RecreateChildControls()

重新建立衍生自 CompositeControl 之控制項的子控制項。Recreates the child controls in a control derived from CompositeControl.

(繼承來源 CompositeControl)
RemovedControl(Control)

Control 物件的 Controls 集合中移除子控制項之後呼叫。Called after a child control is removed from the Controls collection of the Control object.

(繼承來源 Control)
Render(HtmlTextWriter)

使用指定的 HTML 寫入器呈現登入表單。Renders the login form using the specified HTML writer.

RenderBeginTag(HtmlTextWriter)

將控制項的 HTML 開頭標記呈現在指定的寫入器中。Renders the HTML opening tag of the control to the specified writer. 這個方法主要由控制項開發人員使用。This method is used primarily by control developers.

(繼承來源 WebControl)
RenderChildren(HtmlTextWriter)

將伺服器控制項子系的內容輸出至提供的 HtmlTextWriter 物件,再由這個物件在用戶端上寫入要轉譯的內容。Outputs the content of a server control's children to a provided HtmlTextWriter object, which writes the content to be rendered on the client.

(繼承來源 Control)
RenderContents(HtmlTextWriter)

將控制項的內容呈現在指定的寫入器。Renders the contents of the control to the specified writer. 這個方法主要由控制項開發人員使用。This method is used primarily by control developers.

(繼承來源 WebControl)
RenderControl(HtmlTextWriter)

將伺服器控制項內容輸出至提供的 HtmlTextWriter 物件,並在啟用追蹤時儲存控制項的追蹤資訊。Outputs server control content to a provided HtmlTextWriter object and stores tracing information about the control if tracing is enabled.

(繼承來源 Control)
RenderControl(HtmlTextWriter, ControlAdapter)

使用提供的 HtmlTextWriter 物件,輸出伺服器控制項內容至提供的 ControlAdapter 物件。Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object.

(繼承來源 Control)
RenderEndTag(HtmlTextWriter)

將控制項的 HTML 結尾標記呈現至指定的寫入器。Renders the HTML closing tag of the control into the specified writer. 這個方法主要由控制項開發人員使用。This method is used primarily by control developers.

(繼承來源 WebControl)
ResolveAdapter()

取得負責呈現指定之控制項的控制項配置器。Gets the control adapter responsible for rendering the specified control.

(繼承來源 Control)
ResolveClientUrl(String)

取得瀏覽器可使用的 URL。Gets a URL that can be used by the browser.

(繼承來源 Control)
ResolveUrl(String)

將 URL 轉換為要求用戶端可使用的 URL。Converts a URL into one that is usable on the requesting client.

(繼承來源 Control)
SaveControlState()

儲存頁面回傳至伺服器以來,所發生的任何伺服器控制項狀態變更。Saves any server control state changes that have occurred since the time the page was posted back to the server.

(繼承來源 Control)
SaveViewState()

儲存叫用 TrackViewState() 方法後已修改的任何狀態。Saves any state that was modified after the TrackViewState() method was invoked.

SetDesignModeState(IDictionary)

設定控制項的設計階段資料。Sets design-time data for a control.

SetRenderMethodDelegate(RenderMethod)

指定事件處理常式委派,以呈現伺服器控制項及其內容至其父控制項。Assigns an event handler delegate to render the server control and its content into its parent control.

(繼承來源 Control)
SetTraceData(Object, Object)

使用追蹤資料機碼和追蹤資料值,設定設計階段期間追蹤呈現資料的追蹤資料。Sets trace data for design-time tracing of rendering data, using the trace data key and the trace data value.

(繼承來源 Control)
SetTraceData(Object, Object, Object)

使用追蹤的物體、追蹤資料機碼和追蹤資料值,設定設計階段期間追蹤呈現資料的追蹤資料。Sets trace data for design-time tracing of rendering data, using the traced object, the trace data key, and the trace data value.

(繼承來源 Control)
ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(繼承來源 Object)
TrackViewState()

覆寫基底 TrackViewState() 方法。Overrides the base TrackViewState() method.

事件

Authenticate

發生於使用者已驗證時。Occurs when a user is authenticated.

DataBinding

發生於伺服器控制項繫結至資料來源時。Occurs when the server control binds to a data source.

(繼承來源 Control)
Disposed

發生於伺服器控制項從記憶體釋放時,這是在要求 ASP.NET 網頁時,伺服器控制項生命週期的最後階段。Occurs when a server control is released from memory, which is the last stage of the server control lifecycle when an ASP.NET page is requested.

(繼承來源 Control)
Init

發生於初始化伺服器控制項時,是其生命週期中的第一個步驟。Occurs when the server control is initialized, which is the first step in its lifecycle.

(繼承來源 Control)
Load

發生於載入伺服器控制項至 Page 物件時。Occurs when the server control is loaded into the Page object.

(繼承來源 Control)
LoggedIn

發生於使用者登入網站且已經過驗證時。Occurs when the user logs in to the Web site and has been authenticated.

LoggingIn

發生於使用者送出登入資訊之後,進行驗證之前。Occurs when a user submits login information, before authentication takes place.

LoginError

發生於偵測到登入錯誤時。Occurs when a login error is detected.

PreRender

Control 物件載入之後但在呈現之前發生。Occurs after the Control object is loaded but prior to rendering.

(繼承來源 Control)
Unload

發生於伺服器控制項從記憶體卸載時。Occurs when the server control is unloaded from memory.

(繼承來源 Control)

明確介面實作

IAttributeAccessor.GetAttribute(String)

使用指定的名稱,取得 Web 控制項的屬性。Gets an attribute of the Web control with the specified name.

(繼承來源 WebControl)
IAttributeAccessor.SetAttribute(String, String)

將 Web 控制項的屬性設定為指定的名稱和值。Sets an attribute of the Web control to the specified name and value.

(繼承來源 WebControl)
ICompositeControlDesignerAccessor.RecreateChildControls()

讓設計工具能在設計階段環境中重新建立複合控制項的子控制項集合。Enables a designer to recreate the composite control's collection of child controls in the design-time environment.

(繼承來源 CompositeControl)
IControlBuilderAccessor.ControlBuilder

如需這個成員的說明,請參閱 ControlBuilderFor a description of this member, see ControlBuilder.

(繼承來源 Control)
IControlDesignerAccessor.GetDesignModeState()

如需這個成員的說明,請參閱 GetDesignModeState()For a description of this member, see GetDesignModeState().

(繼承來源 Control)
IControlDesignerAccessor.SetDesignModeState(IDictionary)

如需這個成員的說明,請參閱 SetDesignModeState(IDictionary)For a description of this member, see SetDesignModeState(IDictionary).

(繼承來源 Control)
IControlDesignerAccessor.SetOwnerControl(Control)

如需這個成員的說明,請參閱 SetOwnerControl(Control)For a description of this member, see SetOwnerControl(Control).

(繼承來源 Control)
IControlDesignerAccessor.UserData

如需這個成員的說明,請參閱 UserDataFor a description of this member, see UserData.

(繼承來源 Control)
IDataBindingsAccessor.DataBindings

如需這個成員的說明,請參閱 DataBindingsFor a description of this member, see DataBindings.

(繼承來源 Control)
IDataBindingsAccessor.HasDataBindings

如需這個成員的說明,請參閱 HasDataBindingsFor a description of this member, see HasDataBindings.

(繼承來源 Control)
IExpressionsAccessor.Expressions

如需這個成員的說明,請參閱 ExpressionsFor a description of this member, see Expressions.

(繼承來源 Control)
IExpressionsAccessor.HasExpressions

如需這個成員的說明,請參閱 HasExpressionsFor a description of this member, see HasExpressions.

(繼承來源 Control)
IParserAccessor.AddParsedSubObject(Object)

如需這個成員的說明,請參閱 AddParsedSubObject(Object)For a description of this member, see AddParsedSubObject(Object).

(繼承來源 Control)

擴充方法

FindDataSourceControl(Control)

傳回與指定之控制項的資料控制項相關聯的資料來源。Returns the data source that is associated with the data control for the specified control.

FindFieldTemplate(Control, String)

傳回在指定之控制項的命名容器中所指定資料行的欄位樣板。Returns the field template for the specified column in the specified control's naming container.

FindMetaTable(Control)

傳回包含資料控制項的中繼資料表物件。Returns the metatable object for the containing data control.

GetDefaultValues(INamingContainer)

取得所指定資料控制項的預設值集合。Gets the collection of the default values for the specified data control.

GetMetaTable(INamingContainer)

取得所指定資料控制項中的資料表中繼資料。Gets the table metadata for the specified data control.

SetMetaTable(INamingContainer, MetaTable)

設定所指定資料控制項中的資料表中繼資料。Sets the table metadata for the specified data control.

SetMetaTable(INamingContainer, MetaTable, IDictionary<String,Object>)

設定所指定資料控制項的資料表中繼資料及預設值對應。Sets the table metadata and default value mapping for the specified data control.

SetMetaTable(INamingContainer, MetaTable, Object)

設定所指定資料控制項的資料表中繼資料及預設值對應。Sets the table metadata and default value mapping for the specified data control.

TryGetMetaTable(INamingContainer, MetaTable)

判斷資料表中繼資料是否可供使用。Determines whether table metadata is available.

EnableDynamicData(INamingContainer, Type)

針對指定的資料控制項啟用動態資料行為。Enables Dynamic Data behavior for the specified data control.

EnableDynamicData(INamingContainer, Type, IDictionary<String,Object>)

針對指定的資料控制項啟用動態資料行為。Enables Dynamic Data behavior for the specified data control.

EnableDynamicData(INamingContainer, Type, Object)

針對指定的資料控制項啟用動態資料行為。Enables Dynamic Data behavior for the specified data control.

適用於

另請參閱