Page 類別

定義

表示從裝載 ASP.NET Web 應用程式的伺服器要求的 .aspx 檔案 (也稱為 Web Forms 頁面)。Represents an .aspx file, also known as a Web Forms page, requested from a server that hosts an ASP.NET Web application.

public ref class Page : System::Web::UI::TemplateControl, System::Web::IHttpHandler
public class Page : System.Web.UI.TemplateControl, System.Web.IHttpHandler
type Page = class
    inherit TemplateControl
    interface IHttpHandler
Public Class Page
Inherits TemplateControl
Implements IHttpHandler
繼承
衍生
實作

範例

本主題提供具有原始程式碼的 Visual Studio 網站專案:下載A Visual Studio Web site project with source code is available to accompany this topic: Download.

下列程式碼範例示範如何在程式碼後置頁面模型中使用 Page 類別。The following code example demonstrates how the Page class is used in the code-behind page model. 請注意,程式碼後置原始程式檔會宣告繼承自基底頁面類別的部分類別。Note that the code-behind source file declares a partial class that inherits from a base page class. 基礎頁面類別可以是 Page,也可以是衍生自 Page的另一個類別。The base page class can be Page, or it can be another class that derives from Page. 此外,請注意,部分類別可讓程式碼後置檔案使用頁面上定義的控制項,而不需要將它們定義為欄位成員。Furthermore, note that the partial class allows the code-behind file to use controls defined on the page without the need to define them as field members.

using System;

public partial class MyCodeBehindCS : System.Web.UI.Page
{     
    protected void Page_Load(object sender, EventArgs e)
    {

        // Place page-specific code here.


    }

    // Define a handler for the button click.
    protected void SubmitBtn_Click(object sender, EventArgs e)
    {	

        MySpan.InnerHtml = "Hello, " + MyTextBox.Text + ".";

    }
}
Partial Class MyCodeBehindVB
    Inherits System.Web.UI.Page


    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

        ' Place page-specific code here.

    End Sub

    ' Define a handler for the button click.
    Protected Sub SubmitBtn_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyButton.Click

        MySpan.InnerHtml = "Hello, " + MyTextBox.Text + "."

    End Sub

End Class

下列程式碼範例會顯示對應至先前程式碼後置原始程式檔的 .aspx 檔案。The following code example shows the .aspx file that corresponds to the preceding code-behind source file.

重要

這個範例有一個可接受使用者輸入的文字方塊,這可能會造成安全性威脅。This example has 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.

<%@ Page Language="C#" CodeFile="pageexample.aspx.cs" Inherits="MyCodeBehindCS" %>

<!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 runat="server">
    <title>Page Class Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
       <table>
          <tr>
            <td> Name: </td>
            <td> <asp:textbox id="MyTextBox" runat="server"/> </td>
          </tr>
          <tr>
             <td></td>
             <td><asp:button id="MyButton" text="Click Here" onclick="SubmitBtn_Click" runat="server"/></td>
          </tr>
          <tr>
             <td></td>
             <td><span id="MySpan" runat="server" /></td>
          </tr>
       </table>     
    </div>
    </form>
</body>
</html>
<%@ Page Language="VB" CodeFile="pageexample.aspx.vb" Inherits="MyCodeBehindVB" %>

<!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 runat="server">
    <title>Page Class Example</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
       <table>
          <tr>
            <td> Name: </td>
            <td> <asp:textbox id="MyTextBox" runat="server"/> </td>
          </tr>
          <tr>
             <td></td>
             <td><asp:button id="MyButton" text="Click Here" onclick="SubmitBtn_Click" runat="server"/></td>
          </tr>
          <tr>
             <td></td>
             <td><span id="MySpan" runat="server" /></td>
          </tr>
       </table>         
    </div>
    </form>
</body>
</html>

您必須使用@ Page指示詞,並使用 InheritsCodeFile 屬性,將程式碼後置檔案連結到 .aspx 檔案。You must use the @ Page directive and use the Inherits and CodeFile attributes to link the code-behind file to the .aspx file. 在此範例中,Inherits 屬性會指出 MyCodeBehind 類別,而 CodeFile 屬性會指出包含類別之特定語言檔案的路徑。In this example, the Inherits attribute indicates the MyCodeBehind class and the CodeFile attribute indicates the path to the language-specific file that contains the class.

下列程式碼範例示範單一檔案頁面模型,以及如何存取 IsPostBack 屬性和 PageResponse 屬性。The following code example demonstrates the single-file page model and how to access the IsPostBack property and the Response property of the Page.

<%@ Page Language="C#" %>

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

  protected void Page_Load(object sender, EventArgs e)
  {
    StringBuilder sb = new StringBuilder();
    
    if (Page.IsPostBack)
      sb.Append("You posted back to the page.<br />");

    sb.Append("The host address is " + Page.Request.UserHostAddress + ".<br />");
    sb.Append("The page title is \"" + Page.Header.Title + "\".");

    PageMessage.Text = sb.ToString();

  }
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Page Class Example</title>
</head>
<body>
    <form id="form1" 
          runat="server">
    <div>
    <asp:Label id="PageMessage" 
               runat="server"/>
    <br /> <br />
    <asp:Button id="PageButton"
                Text="PostBack"
                runat="server" />
    </div>
    </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">

  Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)

    Dim sb As New StringBuilder()
    
    If (Page.IsPostBack) Then
      
      sb.Append("You posted back to the page.<br />")
    
    End If
    
    sb.Append("The host address is " + Page.Request.UserHostAddress + ".<br />")
    sb.Append("The page title is """ + Page.Header.Title + """.")
    
    PageMessage.Text = sb.ToString()
    
  End Sub
  
</script>

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Page Class Example</title>
</head>
<body>
    <form id="form1" 
          runat="server">
    <div>
    <asp:Label id="PageMessage" 
               runat="server"/>
    <br /> <br />
    <asp:Button id="PageButton"
                Text="PostBack"
                runat="server" />    
    </div>
    </form>
</body>
</html>

備註

Page 類別與副檔名為 .aspx 的檔案相關聯。The Page class is associated with files that have an .aspx extension. 這些檔案會在執行時間編譯為 Page 物件,並在伺服器記憶體中快取。These files are compiled at run time as Page objects and cached in server memory.

如果您想要使用程式碼後置技術建立 Web form 頁面,請從這個類別衍生。If you want to create a Web Forms page using the code-behind technique, derive from this class. 快速的應用程式開發(RAD)設計工具(例如 Microsoft Visual Studio)會自動使用此模型來建立 Web form 頁面。Rapid application development (RAD) designers, such as Microsoft Visual Studio, automatically use this model to create Web Forms pages.

Page 物件可做為頁面中所有伺服器控制項的命名容器,但實作為 INamingContainer 介面,或為實作為介面之控制項的子控制項。The Page object serves as the naming container for all server controls in a page, except those that implement the INamingContainer interface or are child controls of controls that implement this interface.

Page 類別是做為 Web 應用程式使用者介面的控制項,因此,您應該仔細檢查以確定已遵循撰寫安全程式碼和保護應用程式的最佳作法。The Page class is a control that acts as the user interface for your Web application, and as such should be scrutinized to make sure best practices for writing secure code and securing applications are followed. 如需有關這些主題的一般資訊,請參閱Web 應用程式安全性威脅安全性原則最佳做法重要安全性概念的總覽。For general information on these topics, see Overview of Web Application Security Threats, Security Policy Best Practices, and Key Security Concepts. 如需更具體的資訊,請參閱保護標準控制項如何:顯示安全的錯誤訊息如何:藉由將 HTML 編碼套用至的字串,以及驗證控制項簡介,防止 Web 應用程式中的腳本入侵。For more specific information, see Securing Standard Controls, How to: Display Safe Error Messages, How to: Protect Against Script Exploits in a Web Application by Applying HTML Encoding to Strings, and Introduction to the Validation Controls.

建構函式

Page()

初始化 Page 類別的新執行個體。Initializes a new instance of the Page class.

欄位

postEventArgumentID

字串,定義呈現頁面中的 EVENTARGUMENT 隱藏欄位。A string that defines the EVENTARGUMENT hidden field in the rendered page.

postEventSourceID

字串,定義呈現頁面中的 EVENTTARGET 隱藏欄位。A string that defines the EVENTTARGET hidden field in the rendered page.

屬性

Adapter

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

(繼承來源 Control)
Application

取得目前 Web 要求的 HttpApplicationState 物件。Gets the HttpApplicationState object for the current Web request.

AppRelativeTemplateSourceDirectory

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

(繼承來源 Control)
AppRelativeVirtualPath

取得或設定要在其中剖析和編譯控制項之檔案的應用程式相對虛擬目錄路徑。Gets or sets the application-relative, virtual directory path to the file from which the control is parsed and compiled.

(繼承來源 TemplateControl)
AspCompatMode

設定數值,指出頁面是否可以在單一執行緒 Apartment (STA) 執行緒上執行。Sets a value indicating whether the page can be executed on a single-threaded apartment (STA) thread.

AsyncMode

設定數值,表示同步或非同步處理頁面。Sets a value indicating whether the page is processed synchronously or asynchronously.

AsyncTimeout

取得或設定數值,表示處理非同步工作時使用的逾時間隔。Gets or sets a value indicating the time-out interval used when processing asynchronous tasks.

AutoHandlers

AutoHandlers 屬性在 ASP.NET 2.0 中已被取代。The AutoHandlers property has been deprecated in ASP.NET NET 2.0. 此屬性由產生的類別使用,並不適用於您的程式碼中。It is used by generated classes and is not intended for use within your code.

(繼承來源 TemplateControl)
AutoPostBackControl

取得或設定頁面中的控制項,這個控制項是用來執行回傳。Gets or sets the control in the page that is used to perform postbacks.

BindingContainer

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

(繼承來源 Control)
Buffer

設定數值,指出是否緩衝頁面輸出。Sets a value indicating whether the page output is buffered.

Cache

取得與網頁所在應用程式相關聯的 Cache 物件。Gets the Cache object associated with the application in which the page resides.

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)
ClientQueryString

取得所要求 URL 的查詢字串部分。Gets the query string portion of the requested URL.

ClientScript

取得 ClientScriptManager 物件,這個物件可用來管理、註冊和加入指令碼至頁面。Gets a ClientScriptManager object used to manage, register, and add script to the page.

ClientTarget

取得或設定數值,讓您覆寫瀏覽器能力的自動偵測,並指定網頁在特定瀏覽器用戶端要如何顯示。Gets or sets a value that allows you to override automatic detection of browser capabilities and to specify how a page is rendered for particular browser clients.

CodePage

設定目前 Page 的字碼頁識別項。Sets the code page identifier for the current Page.

ContentType

設定與頁面關聯之 HttpResponse 物件的 HTTP MIME 類型。Sets the HTTP MIME type for the HttpResponse object associated with the page.

Context

取得與網頁關聯的 HttpContext 物件。Gets the HttpContext object associated with the page.

Controls

取得 ControlCollection 物件,表示 UI 階層架構中指定之伺服器控制項的子控制項。Gets a ControlCollection object that represents the child controls for a specified server control in the UI hierarchy.

(繼承來源 Control)
Culture

針對與頁面關聯的 Thread 物件,設定其文化特性 ID。Sets the culture ID for the Thread object associated with the page.

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)
EnableEventValidation

取得或設定值,指出頁面是否驗證回傳和回呼事件。Gets or sets a value indicating whether the page validates postback and callback events.

EnableTheming

取得或設定布林值,指出主題是否套用至衍生自 TemplateControl 類別的控制項。Gets or sets a Boolean value indicating whether themes apply to the control that is derived from the TemplateControl class.

(繼承來源 TemplateControl)
EnableViewState

取得或設定值,指出在目前的網頁要求結束時,網頁是否要保持其檢視狀態和它所包含的任何伺服器控制項的檢視狀態。Gets or sets a value indicating whether the page maintains its view state, and the view state of any server controls it contains, when the current page request ends.

EnableViewStateMac

取得或設定值,這個值表示從用戶端回傳網頁時,ASP.NET 是否應該檢查網頁檢視狀態中的訊息驗證碼 (MAC)。Gets or sets a value indicating whether ASP.NET should check message authentication codes (MAC) in the page's view state when the page is posted back from the client.

ErrorPage

取得或設定發出要求的瀏覽器被重新導向的錯誤網頁 (當未處理的網頁例外狀況發生時)。Gets or sets the error page to which the requesting browser is redirected in the event of an unhandled page exception.

Events

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

(繼承來源 Control)
FileDependencies

設定目前 HttpResponse 物件相依的檔案陣列。Sets an array of files that the current HttpResponse object is dependent upon.

Form

取得頁面的 HTML 表單。Gets the HTML form for the page.

HasChildViewState

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

(繼承來源 Control)
Header

取得頁面的文件標頭,如果在頁面宣告中使用 head 定義 runat=server 項目。Gets the document header for the page if the head element is defined with a runat=server in the page declaration.

ID

取得或設定 Page 類別的特定執行個體識別項。Gets or sets an identifier for a particular instance of the Page class.

IdSeparator

取得字元,於建置頁面上控制項的唯一 ID 時,使用此字元分隔控制識別項。Gets the character used to separate control identifiers when building a unique ID for a control on a page.

IsAsync

取得值,指出是否非同步處理頁面。Gets a value indicating whether the page is processed asynchronously.

IsCallback

取得值,這個值表示網頁要求是否為回呼的結果。Gets a value that indicates whether the page request is the result of a callback.

IsChildControlStateCleared

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

(繼承來源 Control)
IsCrossPagePostBack

取得值,指出頁面是否包含在跨網頁回傳中。Gets a value indicating whether the page is involved in a cross-page postback.

IsPostBack

取得值,這個值表示網頁為初次呈現,或是要回應回傳而載入。Gets a value that indicates whether the page is being rendered for the first time or is being loaded in response to a postback.

IsPostBackEventControlRegistered

取得值,這個值指示在該頁面中執行回傳的控制項是否已註冊。Gets a value that indicates whether the control in the page that performs postbacks has been registered.

IsReusable

取得值,指出 Page 物件是否可以重複使用。Gets a value indicating whether the Page object can be reused.

IsTrackingViewState

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

(繼承來源 Control)
IsValid

取得值,指出網頁驗證是否成功。Gets a value indicating whether page validation succeeded.

IsViewStateEnabled

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

(繼承來源 Control)
Items

取得頁面內容中儲存的物件清單。Gets a list of objects stored in the page context.

LCID

針對與頁面關聯的 Thread 物件,設定其地區設定識別項。Sets the locale identifier for the Thread object associated with the page.

LoadViewStateByID

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

(繼承來源 Control)
MaintainScrollPositionOnPostBack

取得或設定值,這個值表示是否要讓使用者在回傳後返回用戶端瀏覽器中的相同位置。Gets or sets a value indicating whether to return the user to the same position in the client browser after postback. 這個屬性會取代已過時的 SmartNavigation 屬性。This property replaces the obsolete SmartNavigation property.

Master

取得決定頁面整體外觀的主版頁面。Gets the master page that determines the overall look of the page.

MasterPageFile

取得或設定主版頁面的虛擬路徑。Gets or sets the virtual path of the master page.

MaxPageStateFieldLength

取得或設定頁面狀態欄位的最大長度。Gets or sets the maximum length for the page's state field.

MetaDescription

取得或設定 "description" meta 項目的內容。Gets or sets the content of the "description" meta element.

MetaKeywords

取得或設定「關鍵字」meta 項目的內容。Gets or sets the content of the "keywords" meta element.

ModelBindingExecutionContext

取得模型繫結執行內容。Gets the model binding execution context.

ModelState

取得模型狀態字典物件,這個物件包含模型和模型繫結驗證的狀態。Gets the model state dictionary object that contains the state of the model and of model-binding validation.

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)
Page

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

(繼承來源 Control)
PageAdapter

取得配置器,為特定要求的瀏覽器呈現頁面。Gets the adapter that renders the page for the specific requesting browser.

PageStatePersister

取得與網頁關聯的 PageStatePersister 物件。Gets the PageStatePersister object associated with the page.

Parent

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

(繼承來源 Control)
PreviousPage

取得將控制權移轉給目前頁面的頁面。Gets the page that transferred control to the current page.

RenderingCompatibility

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

(繼承來源 Control)
Request

取得所要求頁面的 HttpRequest 物件。Gets the HttpRequest object for the requested page.

Response

取得與 Page 物件相關聯的 HttpResponse 物件。Gets the HttpResponse object associated with the Page object. 此物件可讓您將 HTTP 回應資料傳送給用戶端,並包含該回應的相關資訊。This object allows you to send HTTP response data to a client and contains information about that response.

ResponseEncoding

設定目前 HttpResponse 物件的編碼語言。Sets the encoding language for the current HttpResponse object.

RouteData

取得目前 RouteData 執行個體的 RequestContext 值。Gets the RouteData value of the current RequestContext instance.

Server

取得 Server 物件,這個物件為 HttpServerUtility 類別的執行個體。Gets the Server object, which is an instance of the HttpServerUtility class.

Session

取得 ASP.NET 提供的目前 Session 物件。Gets the current Session object provided by ASP.NET.

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.

(繼承來源 Control)
SkipFormActionValidation

取得或設定值,指出查詢字串值是否已驗證。Gets or sets a value that indicates whether the query string value is validated.

SmartNavigation

取得或設定值,表示是否允許智慧型巡覽。Gets or sets a value indicating whether smart navigation is enabled. 這個屬性已被取代。This property is deprecated.

StyleSheetTheme

取得或設定在網頁生命週期早期套用至網頁的佈景主題名稱。Gets or sets the name of the theme that is applied to the page early in the page life cycle.

SupportAutoEvents

取得值,指出 TemplateControl 控制項是否支援自動事件。Gets a value indicating whether the TemplateControl control supports automatic events.

(繼承來源 TemplateControl)
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)
Theme

取得或設定頁面主題的名稱。Gets or sets the name of the page theme.

Title

取得或設定頁面的標題。Gets or sets the title for the page.

Trace

取得目前 Web 要求的 TraceContext 物件。Gets the TraceContext object for the current Web request.

TraceEnabled

設定數值,指出是否啟用 Page 物件的追蹤。Sets a value indicating whether tracing is enabled for the Page object.

TraceModeValue

設定頁面上追蹤陳述式的顯示模式。Sets the mode in which trace statements are displayed on the page.

TransactionMode

設定頁面的異動支援層級。Sets the level of transaction support for the page.

UICulture

針對與頁面關聯的 Thread 物件,設定其使用者介面 (UI) ID。Sets the user interface (UI) ID for the Thread object associated with the page.

UniqueFilePathSuffix

取得附加至快取瀏覽器檔案路徑的唯一尾碼。Gets a unique suffix to append to the file path for caching browsers.

UniqueID

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

(繼承來源 Control)
UnobtrusiveValidationMode

取得或設定值,指出是否針對用戶端驗證使用 Unobtrusive JavaScript。Gets or sets a value that indicates whether unobtrusive JavaScript is used for client-side validation.

User

取得要求網頁的使用者資訊。Gets information about the user making the page request.

ValidateRequestMode

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

Validators

取得被要求的網頁中所有包含的驗證控制項集合。Gets a collection of all validation controls contained on the requested page.

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)
ViewStateEncryptionMode

取得或設定檢視狀態的加密模式。Gets or sets the encryption mode of the view state.

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)
ViewStateUserKey

在與目前網頁相關的檢視狀態變數中,指派識別項給個別的使用者。Assigns an identifier to an individual user in the view-state variable associated with the current page.

Visible

取得或設定值,指出是否呈現 Page 物件。Gets or sets a value indicating whether the Page object is rendered.

方法

AddContentTemplate(String, ITemplate)

在頁面初始化時呼叫,用來從內容控制項建立內容的集合,以傳至主版頁面 (如果目前頁面或主版頁面參考主版頁面的話)。Called during page initialization to create a collection of content (from content controls) that is handed to a master page, if the current page or master page refers to a master page.

AddedControl(Control, Int32)

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

(繼承來源 Control)
AddOnPreRenderCompleteAsync(BeginEventHandler, EndEventHandler)

為非同步頁面,註冊不需要狀態資訊的開始與結束事件處理常式委派。Registers beginning and ending event handler delegates that do not require state information for an asynchronous page.

AddOnPreRenderCompleteAsync(BeginEventHandler, EndEventHandler, Object)

為非同步頁面,註冊開始與結束事件處理常式委派。Registers beginning and ending event handler delegates for an asynchronous page.

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)
AddWrappedFileDependencies(Object)

加入組成目前頁面的相依檔案清單。Adds a list of dependent files that make up the current page. 這個方法是由 ASP.NET 網頁架構在內部使用,並不適合直接從程式碼使用。This method is used internally by the ASP.NET page framework and is not intended to be used directly from your code.

ApplyStyleSheetSkin(Page)

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

(繼承來源 Control)
AspCompatBeginProcessRequest(HttpContext, AsyncCallback, Object)

啟始 Active Server Page (ASP) 資源的要求。Initiates a request for Active Server Page (ASP) resources. 基於與舊版 ASP 應用程式的相容性,提供這個方法。This method is provided for compatibility with legacy ASP applications.

AspCompatEndProcessRequest(IAsyncResult)

結束 Active Server Page (ASP) 資源的要求。Terminates a request for Active Server Page (ASP) resources. 基於與舊版 ASP 應用程式的相容性,提供這個方法。This method is provided for compatibility with legacy ASP applications.

AsyncPageBeginProcessRequest(HttpContext, AsyncCallback, Object)

開始處理非同步頁面要求。Begins processing an asynchronous page request.

AsyncPageEndProcessRequest(IAsyncResult)

結束處理非同步頁面要求。Ends processing an asynchronous page request.

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)
Construct()

執行設計階段邏輯。Performs design-time logic.

(繼承來源 TemplateControl)
CreateChildControls()

由 ASP.NET 網頁架構呼叫,通知使用組合實作的伺服器控制項來建立所包含的任何子控制項,以準備回傳或呈現。Called by the ASP.NET page framework to notify server controls that use composition-based implementation to create any child controls they contain in preparation for posting back or rendering.

(繼承來源 Control)
CreateControlCollection()

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

(繼承來源 Control)
CreateHtmlTextWriter(TextWriter)

建立 HtmlTextWriter 物件以呈現網頁內容。Creates an HtmlTextWriter object to render the page's content.

CreateHtmlTextWriterFromType(TextWriter, Type)

建立指定的 HtmlTextWriter 物件,以呈現頁面內容。Creates a specified HtmlTextWriter object to render the page's content.

CreateResourceBasedLiteralControl(Int32, Int32, Boolean)

存取儲存在資源中的常值字串。Accesses literal strings stored in a resource. CreateResourceBasedLiteralControl(Int32, Int32, Boolean) 方法並不適合從您的程式碼使用。The CreateResourceBasedLiteralControl(Int32, Int32, Boolean) method is not intended for use from within your code.

(繼承來源 TemplateControl)
DataBind()

將資料來源繫結至所叫用的伺服器控制項及其所有子控制項。Binds a data source to the invoked server control and all its child controls.

(繼承來源 Control)
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)
DesignerInitialize()

執行被 RAD 設計工具要求的 Page 類別之執行個體初始化。Performs any initialization of the instance of the Page class that is required by RAD designers. 這個方法只能在設計階段使用。This method is used only at design time.

DeterminePostBackMode()

使用 POST 或 GET 命令傳回,回傳至頁面的資料 NameValueCollectionReturns a NameValueCollection of data posted back to the page using either a POST or a GET command.

DeterminePostBackModeUnvalidated()

傳回使用 POST 或 GET 命令發佈至網頁中的資料名稱-值集合,但不對要求執行 ASP.NET 要求驗證。Returns a name-value collection of data that was posted to the page using either a POST or a GET command, without performing ASP.NET request validation on the request.

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)
Eval(String)

評估資料繫結運算式。Evaluates a data-binding expression.

(繼承來源 TemplateControl)
Eval(String, String)

使用指定的格式字串評估資料繫結運算式以顯示結果。Evaluates a data-binding expression using the specified format string to display the result.

(繼承來源 TemplateControl)
ExecuteRegisteredAsyncTasks()

開始執行非同步工作。Starts the execution of an asynchronous task.

FindControl(String)

在頁面命名容器中搜尋具有指定識別項的伺服器控制項。Searches the page naming container for a server control with the specified identifier.

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)
FrameworkInitialize()

根據頁面的宣告式性質,在頁面產生期間初始化控制項樹狀結構。Initializes the control tree during page generation based on the declarative nature of the page.

GetDataItem()

取得資料繫結內容堆疊頂層的資料項目。Gets the data item at the top of the data-binding context stack.

GetDesignModeState()

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

(繼承來源 Control)
GetGlobalResourceObject(String, String)

根據指定的 ClassKeyResourceKey 屬性,取得應用程式層級資源物件。Gets an application-level resource object based on the specified ClassKey and ResourceKey properties.

(繼承來源 TemplateControl)
GetGlobalResourceObject(String, String, Type, String)

根據指定的 ClassKeyResourceKey 屬性、物件型別和資源的屬性名稱,取得應用程式層級資源物件。Gets an application-level resource object based on the specified ClassKey and ResourceKey properties, object type, and property name of the resource.

(繼承來源 TemplateControl)
GetHashCode()

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

(繼承來源 Object)
GetLocalResourceObject(String)

根據指定的 ResourceKey 屬性,取得頁面層級資源物件。Gets a page-level resource object based on the specified ResourceKey property.

(繼承來源 TemplateControl)
GetLocalResourceObject(String, Type, String)

根據指定的 ResourceKey 屬性、物件型別和屬性名稱,取得頁面層級資源物件。Gets a page-level resource object based on the specified ResourceKey property, object type, and property name.

(繼承來源 TemplateControl)
GetPostBackClientEvent(Control, String)

取得可用於用戶端事件的參考,以針對指定的控制項回傳至伺服器,並且包含指定的事件參數。Gets a reference that can be used in a client event to post back to the server for the specified control and with the specified event arguments.

GetPostBackClientHyperlink(Control, String)

取得可用於用戶端事件中的參考,並附加 javascript: 至其開頭,針對指定控制項並以指定事件引數回傳給伺服器。Gets a reference, with javascript: appended to the beginning of it, that can be used in a client event to post back to the server for the specified control and with the specified event arguments.

GetPostBackEventReference(Control)

傳回字串,該字串可用於用戶端事件中造成回傳給伺服器。Returns a string that can be used in a client event to cause postback to the server. 指定的 Control 物件會定義參考字串。The reference string is defined by the specified Control object.

GetPostBackEventReference(Control, String)

傳回字串,該字串可用於用戶端事件中造成回傳給伺服器。Returns a string that can be used in a client event to cause postback to the server. 參考字串是由處理回傳的指定控制項和其他事件資訊的字串引數所定義。The reference string is defined by the specified control that handles the postback and a string argument of additional event information.

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)
GetTypeHashCode()

擷取由 Run Time 產生的 Page 物件所產生的雜湊碼。Retrieves a hash code that is generated by Page objects that are generated at run time. 這個雜湊碼對於 Page 物件的控制階層架構而言是唯一的。This hash code is unique to the Page object's control hierarchy.

GetUniqueIDRelativeTo(Control)

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

(繼承來源 Control)
GetValidators(String)

傳回指定驗證群組的控制項驗證程式集合。Returns a collection of control validators for a specified validation group.

GetWrappedFileDependencies(String[])

傳回對應於虛擬檔案位置清單的實體檔名清單。Returns a list of physical file names that correspond to a list of virtual file locations.

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)
InitializeCulture()

設定頁面目前執行緒的 CultureUICultureSets the Culture and UICulture for the current thread of the page.

InitOutputCache(Int32, String, String, OutputCacheLocation, String)

為目前網頁要求初始化輸出快取。Initializes the output cache for the current page request.

InitOutputCache(Int32, String, String, String, OutputCacheLocation, String)

為目前網頁要求初始化輸出快取。Initializes the output cache for the current page request.

InitOutputCache(OutputCacheParameters)

根據 OutputCacheParameters 物件,初始化目前頁面要求的輸出快取。Initializes the output cache for the current page request based on an OutputCacheParameters object.

IsClientScriptBlockRegistered(String)

判斷具有指定索引鍵的用戶端指令碼區塊是否已向頁面註冊。Determines whether the client script block with the specified key is registered with the page.

IsLiteralContent()

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

(繼承來源 Control)
IsStartupScriptRegistered(String)

判斷用戶端啟始指令碼是否已使用 Page 物件註冊。Determines whether the client startup script is registered with the Page object.

LoadControl(String)

根據指定的虛擬路徑,從檔案載入 Control 物件。Loads a Control object from a file based on a specified virtual path.

(繼承來源 TemplateControl)
LoadControl(Type, Object[])

根據指定的型別和建構函式參數,載入 Control 物件。Loads a Control object based on a specified type and constructor parameters.

(繼承來源 TemplateControl)
LoadControlState(Object)

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

(繼承來源 Control)
LoadPageStateFromPersistenceMedium()

將任何儲存的檢視狀態資訊載入 Page 物件。Loads any saved view-state information to the Page object.

LoadTemplate(String)

從外部檔案取得 ITemplate 介面的執行個體。Obtains an instance of the ITemplate interface from an external file.

(繼承來源 TemplateControl)
LoadViewState(Object)

SaveViewState() 方法所儲存的先前頁面要求來還原檢視狀態資訊。Restores view-state information from a previous page request that was saved by the SaveViewState() method.

(繼承來源 Control)
MapPath(String)

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

MapPathSecure(String)

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

(繼承來源 Control)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 Object)
OnAbortTransaction(EventArgs)

引發 AbortTransaction 事件。Raises the AbortTransaction event.

(繼承來源 TemplateControl)
OnBubbleEvent(Object, EventArgs)

決定伺服器控制項的事件是否要在頁面的 UI 伺服器控制項階層架構中向上傳遞。Determines whether the event for the server control is passed up the page's UI server control hierarchy.

(繼承來源 Control)
OnCommitTransaction(EventArgs)

引發 CommitTransaction 事件。Raises the CommitTransaction event.

(繼承來源 TemplateControl)
OnDataBinding(EventArgs)

引發 DataBinding 事件。Raises the DataBinding event.

(繼承來源 Control)
OnError(EventArgs)

引發 Error 事件。Raises the Error event.

(繼承來源 TemplateControl)
OnInit(EventArgs)

引發 Init 事件,以初始化頁面。Raises the Init event to initialize the page.

OnInitComplete(EventArgs)

在頁面初始化之後,引發 InitComplete 事件。Raises the InitComplete event after page initialization.

OnLoad(EventArgs)

引發 Load 事件。Raises the Load event.

(繼承來源 Control)
OnLoadComplete(EventArgs)

在頁面載入階段結尾,引發 LoadComplete 事件。Raises the LoadComplete event at the end of the page load stage.

OnPreInit(EventArgs)

在頁面初始化的開始處引發 PreInit 事件。Raises the PreInit event at the beginning of page initialization.

OnPreLoad(EventArgs)

在回傳資料載入頁面伺服器控制項之後,但在 PreLoad 事件之前,引發 OnLoad(EventArgs) 事件。Raises the PreLoad event after postback data is loaded into the page server controls but before the OnLoad(EventArgs) event.

OnPreRender(EventArgs)

引發 PreRender 事件。Raises the PreRender event.

(繼承來源 Control)
OnPreRenderComplete(EventArgs)

PreRenderComplete 事件之後,並在呈現頁面之前,引發 OnPreRenderComplete(EventArgs) 事件。Raises the PreRenderComplete event after the OnPreRenderComplete(EventArgs) event and before the page is rendered.

OnSaveStateComplete(EventArgs)

在頁面狀態已儲存至保存性媒體之後,引發 SaveStateComplete 事件。Raises the SaveStateComplete event after the page state has been saved to the persistence medium.

OnUnload(EventArgs)

引發 Unload 事件。Raises the Unload event.

(繼承來源 Control)
OpenFile(String)

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

(繼承來源 Control)
ParseControl(String)

在 Web Form 網頁或使用者控制項上,將輸入字串剖析為 Control 物件。Parses an input string into a Control object on the Web Forms page or user control.

(繼承來源 TemplateControl)
ParseControl(String, Boolean)

在 ASP.NET 網頁或使用者控制項上,將輸入字串剖析為 Control 物件。Parses an input string into a Control object on the ASP.NET Web page or user control.

(繼承來源 TemplateControl)
ProcessRequest(HttpContext)

設定 Page 物件的內建伺服器物件,例如 ContextRequestResponseApplication 屬性。Sets the intrinsic server objects of the Page object, such as the Context, Request, Response, and Application properties.

RaiseBubbleEvent(Object, EventArgs)

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

(繼承來源 Control)
RaisePostBackEvent(IPostBackEventHandler, String)

告知造成回傳的伺服器控制項,應該處理收到的回傳事件。Notifies the server control that caused the postback that it should handle an incoming postback event.

ReadStringResource()

讀取字串資源。Reads a string resource. ReadStringResource() 方法並不適合從您的程式碼使用。The ReadStringResource() method is not intended for use from within your code.

(繼承來源 TemplateControl)
RegisterArrayDeclaration(String, String)

宣告在呈現頁面時宣告為 ECMAScript 陣列宣告的值。Declares a value that is declared as an ECMAScript array declaration when the page is rendered.

RegisterAsyncTask(PageAsyncTask)

向頁面註冊新的非同步工作。Registers a new asynchronous task with the page.

RegisterClientScriptBlock(String, String)

發出用戶端指令碼區塊給回應。Emits client-side script blocks to the response.

RegisterHiddenField(String, String)

允許伺服器控制項自動在表單上登錄隱藏欄位。Allows server controls to automatically register a hidden field on the form. 在呈現 Page 伺服器控制項時,會將此欄位傳送到 HtmlForm 物件。The field will be sent to the Page object when the HtmlForm server control is rendered.

RegisterOnSubmitStatement(String, String)

允許網頁存取用戶端 OnSubmit 事件。Allows a page to access the client OnSubmit event. 指令碼應該為登錄於別處的用戶端程式碼之函式呼叫。The script should be a function call to client code registered elsewhere.

RegisterRequiresControlState(Control)

將控制項註冊為,必須保存控制項狀態的控制項。Registers a control as one whose control state must be persisted.

RegisterRequiresPostBack(Control)

將控制項註冊為,當頁面回傳給伺服器時,需要回傳處理的控制項。Registers a control as one that requires postback handling when the page is posted back to the server.

RegisterRequiresRaiseEvent(IPostBackEventHandler)

將 ASP.NET 伺服器控制項註冊為,在 Page 物件上處理控制項時,要求引發事件的控制項。Registers an ASP.NET server control as one requiring an event to be raised when the control is processed on the Page object.

RegisterRequiresViewStateEncryption()

向頁面註冊控制項,成為需要檢視狀態加密的控制項。Registers a control with the page as one requiring view-state encryption.

RegisterStartupScript(String, String)

在頁面回應中發出用戶端指令碼區塊。Emits a client-side script block in the page response.

RegisterViewStateHandler()

呼叫時會使網頁檢視狀態被保存 (Persist)。Causes page view state to be persisted, if called.

RemovedControl(Control)

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

(繼承來源 Control)
Render(HtmlTextWriter)

初始化 HtmlTextWriter 物件,並針對要呈現的 Page 子控制項呼叫。Initializes the HtmlTextWriter object and calls on the child controls of the Page to render.

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)
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)
RequiresControlState(Control)

判斷指定的 Control 物件是否已註冊要參與控制項狀態管理。Determines whether the specified Control object is registered to participate in control state management.

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)
SavePageStateToPersistenceMedium(Object)

儲存頁面的任何檢視狀態和控制項狀態資訊。Saves any view-state and control-state information for the page.

SaveViewState()

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

(繼承來源 Control)
SetDesignModeState(IDictionary)

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

(繼承來源 Control)
SetFocus(Control)

將瀏覽器焦點設為指定的控制項。Sets the browser focus to the specified control.

SetFocus(String)

將瀏覽器焦點設為具有指定識別項的控制項。Sets the browser focus to the control with the specified identifier.

SetRenderMethodDelegate(RenderMethod)

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

(繼承來源 Control)
SetStringResourcePointer(Object, Int32)

設定字串資源的指標。Sets a pointer to a string resource. SetStringResourcePointer(Object, Int32) 方法由產生的類別使用,並不適合從您的程式碼使用。The SetStringResourcePointer(Object, Int32) method is used by generated classes and is not intended for use from within your code.

(繼承來源 TemplateControl)
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)
TestDeviceFilter(String)

傳回布林值,指出裝置篩選條件是否套用至 HTTP 要求。Returns a Boolean value indicating whether a device filter applies to the HTTP request.

(繼承來源 TemplateControl)
ToString()

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

(繼承來源 Object)
TrackViewState()

導致對伺服器控制項的檢視狀態變更的追蹤 (Tracking),以便它們能夠儲存於伺服器控制項的 StateBag 物件。Causes tracking of view-state changes to the server control so they can be stored in the server control's StateBag object. 這個物件可透過 ViewState 屬性存取。This object is accessible through the ViewState property.

(繼承來源 Control)
TryUpdateModel<TModel>(TModel)

使用資料繫結控制項的值來更新指定的模型執行個體。Updates the specified model instance using values from the data-bound control.

TryUpdateModel<TModel>(TModel, IValueProvider)

使用來自指定的值提供者的值更新模型執行個體。Updates the model instance using values from the specified value provider.

UnregisterRequiresControlState(Control)

停止指定之控制項狀態的保存性。Stops persistence of control state for the specified control.

UpdateModel<TModel>(TModel)

使用資料繫結控制項的值來更新指定的模型執行個體。Updates the specified model instance using values from the data-bound control.

UpdateModel<TModel>(TModel, IValueProvider)

使用來自指定的值提供者的值更新指定的模型執行個體。Updates the specified model instance using values from a specified value provider.

Validate()

指示網頁上包含的任何驗證控制項來驗證它們已指派的資訊。Instructs any validation controls included on the page to validate their assigned information.

Validate(String)

指示指定驗證群組中的驗證控制項,驗證其指派的資訊。Instructs the validation controls in the specified validation group to validate their assigned information.

VerifyRenderingInServerForm(Control)

確認在 Run Time 時期呈現了所指定 ASP.NET 伺服器控制項的 HtmlForm 控制項。Confirms that an HtmlForm control is rendered for the specified ASP.NET server control at run time.

WriteUTF8ResourceString(HtmlTextWriter, Int32, Int32, Boolean)

將資源字串寫入 HtmlTextWriter 控制項。Writes a resource string to an HtmlTextWriter control. WriteUTF8ResourceString(HtmlTextWriter, Int32, Int32, Boolean) 方法由產生的類別使用,並不適合從您的程式碼使用。The WriteUTF8ResourceString(HtmlTextWriter, Int32, Int32, Boolean) method is used by generated classes and is not intended for use from within your code.

(繼承來源 TemplateControl)
XPath(String)

評估 XPath 資料繫結運算式。Evaluates an XPath data-binding expression.

(繼承來源 TemplateControl)
XPath(String, IXmlNamespaceResolver)

使用命名空間解析所需之指定的前置詞和命名空間對應,評估 XPath 資料繫結運算式。Evaluates an XPath data-binding expression using the specified prefix and namespace mappings for namespace resolution.

(繼承來源 TemplateControl)
XPath(String, String)

使用指定的格式字串評估 XPath 資料繫結運算式以顯示結果。Evaluates an XPath data-binding expression using the specified format string to display the result.

(繼承來源 TemplateControl)
XPath(String, String, IXmlNamespaceResolver)

使用命名空間解析所需之指定的前置詞和命名空間對應,以及指定的格式字串,評估 XPath 資料繫結運算式以顯示結果。Evaluates an XPath data-binding expression using the specified prefix and namespace mappings for namespace resolution and the specified format string to display the result.

(繼承來源 TemplateControl)
XPathSelect(String)

評估 XPath 資料繫結運算式,並傳回可以實作 IEnumerable 介面的節點集合。Evaluates an XPath data-binding expression and returns a node collection that implements the IEnumerable interface.

(繼承來源 TemplateControl)
XPathSelect(String, IXmlNamespaceResolver)

使用命名空間解析所需之指定的前置詞和命名空間對應,評估 XPath 資料繫結運算式,並傳回實作 IEnumerable 介面的節點集合。Evaluates an XPath data-binding expression using the specified prefix and namespace mappings for namespace resolution and returns a node collection that implements the IEnumerable interface.

(繼承來源 TemplateControl)

事件

AbortTransaction

在使用者結束交易時發生。Occurs when a user ends a transaction.

(繼承來源 TemplateControl)
CommitTransaction

當交易完成時發生。Occurs when a transaction completes.

(繼承來源 TemplateControl)
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)
Error

當擲回未處理的例外狀況時發生。Occurs when an unhandled exception is thrown.

(繼承來源 TemplateControl)
Init

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

(繼承來源 Control)
InitComplete

當頁面初始化完成時發生。Occurs when page initialization is complete.

Load

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

(繼承來源 Control)
LoadComplete

在頁面生命週期的載入階段結尾發生。Occurs at the end of the load stage of the page's life cycle.

PreInit

在頁面初始化之前發生。Occurs before page initialization.

PreLoad

在頁面 Load 事件之前發生。Occurs before the page Load event.

PreRender

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

(繼承來源 Control)
PreRenderComplete

在呈現頁面內容之前發生。Occurs before the page content is rendered.

SaveStateComplete

在頁面完成儲存頁面和頁面控制項的所有檢視狀態和控制項狀態資訊之後發生。Occurs after the page has completed saving all view state and control state information for the page and controls on the page.

Unload

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

(繼承來源 Control)

明確介面實作

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)
IFilterResolutionService.CompareFilters(String, String)

傳回值,指出兩個指定的裝置篩選條件之間是否存在父子式關聯性。Returns a value that indicates whether a parent/child relationship exists between two specified device filters.

(繼承來源 TemplateControl)
IFilterResolutionService.EvaluateFilter(String)

傳回值,指出指定的篩選條件是否為目前篩選條件物件的類型。Returns a value that indicates whether the specified filter is a type of the current filter object.

(繼承來源 TemplateControl)
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.

適用於

另請參閱