通过


Panel 类

定义

表示充当其他控件的容器的控件。

public ref class Panel : System::Web::UI::WebControls::WebControl
public class Panel : System.Web.UI.WebControls.WebControl
type Panel = class
    inherit WebControl
Public Class Panel
Inherits WebControl
继承
派生

示例

下面的示例演示如何使用 Panel 控件以编程方式生成控件,以及隐藏/显示一组控件。

注释

下面的代码示例使用单文件代码模型,如果直接复制到代码隐藏文件中,可能无法正常工作。 必须将此代码示例复制到扩展名为 .aspx 的空文本文件中。 有关 Web 窗体代码模型的详细信息,请参阅 ASP.NET Web 窗体页代码模型

<%@ Page Language="C#" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
 <head>
    <title>Panel Example</title>
<script runat="server">
 
       void Page_Load(Object sender, EventArgs e) {
         
          // Show or hide the Panel contents.
         
          if (Check1.Checked) {
             Panel1.Visible=false;
          }
          else {
             Panel1.Visible=true;
          }
 
          // Generate the Label controls.
             
          int numlabels = Int32.Parse(DropDown1.SelectedItem.Value);
             
          for (int i=1; i<=numlabels; i++) {
             Label l = new Label();
             l.Text = "Label" + (i).ToString();
             l.ID = "Label" + (i).ToString();
             Panel1.Controls.Add(l);
             Panel1.Controls.Add(new LiteralControl("<br />"));
          }
 
          // Generate the Textbox controls.
             
          int numtexts = Int32.Parse(DropDown2.SelectedItem.Value);
             
          for (int i=1; i<=numtexts; i++) {
             TextBox t = new TextBox();
             t.Text = "TextBox" + (i).ToString();
             t.ID = "TextBox" + (i).ToString();
             Panel1.Controls.Add(t);
             Panel1.Controls.Add(new LiteralControl("<br />"));
          }
       }
 
    </script>
 
 </head>
 <body>
 
    <h3>Panel Example</h3>
 
    <form id="form1" runat="server">
 
       <asp:Panel id="Panel1" runat="server"
            BackColor="gainsboro"
            Height="200px"
            Width="300px">
 
            Panel1: Here is some static content...
            <br />
 
       </asp:Panel>
 
       <br />
         
       Generate Labels:
       <asp:DropDownList id="DropDown1" runat="server">
          <asp:ListItem Value="0">0</asp:ListItem>
          <asp:ListItem Value="1">1</asp:ListItem>
          <asp:ListItem Value="2">2</asp:ListItem>
          <asp:ListItem Value="3">3</asp:ListItem>
          <asp:ListItem Value="4">4</asp:ListItem>
       </asp:DropDownList>
 
       <br />
         
       Generate TextBoxes:
       <asp:DropDownList id="DropDown2" runat="server">
          <asp:ListItem Value="0">0</asp:ListItem>
          <asp:ListItem Value="1">1</asp:ListItem>
          <asp:ListItem Value="2">2</asp:ListItem>
          <asp:ListItem Value="3">3</asp:ListItem>
          <asp:ListItem Value="4">4</asp:ListItem>
       </asp:DropDownList>
 
       <br />
       <asp:CheckBox id="Check1" Text="Hide Panel" runat="server"/>
             
       <br />
       <asp:Button Text="Refresh Panel" runat="server"/>
 
    
    </form>
 
 </body>
 </html>
<%@ Page Language="VB" AutoEventWireup="True" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
 <head>
    <title>Panel Example</title>
<script runat="server">

    Sub Page_Load(sender As Object, e As EventArgs)
        
        ' Show or Hide the Panel contents.
        If Check1.Checked Then
            Panel1.Visible = False
        Else
            Panel1.Visible = True
        End If
        
        ' Generate the Label controls.
        Dim numlabels As Integer = Int32.Parse(DropDown1.SelectedItem.Value)
        
        Dim i As Integer
        For i = 1 To numlabels
            Dim l As New Label()
            l.Text = "Label" + i.ToString()
            l.ID = "Label" + i.ToString()
            Panel1.Controls.Add(l)
            Panel1.Controls.Add(New LiteralControl("<br />"))
        Next i
        
        ' Generate the Textbox controls.
        Dim numtexts As Integer = Int32.Parse(DropDown2.SelectedItem.Value)
        
        For i = 1 To numtexts
            Dim t As New TextBox()
            t.Text = "TextBox" & i.ToString()
            t.ID = "TextBox" & i.ToString()
            Panel1.Controls.Add(t)
            Panel1.Controls.Add(New LiteralControl("<br />"))
        Next i
    End Sub
 
    </script>
 
 </head>
 <body>
 
    <h3>Panel Example</h3>
 
    <form id="form1" runat="server">
 
       <asp:Panel id="Panel1" runat="server"
            BackColor="gainsboro"
            Height="200px"
            Width="300px">
 
            Panel1: Here is some static content...
            <br />
 
       </asp:Panel>
 
       <br />
         
       Generate Labels:
       <asp:DropDownList id="DropDown1" runat="server">
          <asp:ListItem Value="0">0</asp:ListItem>
          <asp:ListItem Value="1">1</asp:ListItem>
          <asp:ListItem Value="2">2</asp:ListItem>
          <asp:ListItem Value="3">3</asp:ListItem>
          <asp:ListItem Value="4">4</asp:ListItem>
       </asp:DropDownList>
 
       <br />
         
       Generate TextBoxes:
       <asp:DropDownList id="DropDown2" runat="server">
          <asp:ListItem Value="0">0</asp:ListItem>
          <asp:ListItem Value="1">1</asp:ListItem>
          <asp:ListItem Value="2">2</asp:ListItem>
          <asp:ListItem Value="3">3</asp:ListItem>
          <asp:ListItem Value="4">4</asp:ListItem>
       </asp:DropDownList>
 
       <br />
       <asp:CheckBox id="Check1" Text="Hide Panel" runat="server"/>
             
       <br />
       <asp:Button Text="Refresh Panel" runat="server"/>
 
    
    </form>
 
 </body>
 </html>

注解

在本主题中:

介绍

Panel 控件是其他控件的容器。 当你希望以编程方式生成控件、隐藏/显示一组控件或本地化一组控件时,它特别有用。

Direction 属性可用于本地化 Panel 控件的内容,以显示从右到左写入的语言(如阿拉伯语或希伯来语)的文本。

Panel 控件提供了多个属性,可用于自定义其内容的行为和显示。 使用属性 BackImageUrl 显示控件的 Panel 自定义图像。 使用属性 ScrollBars 为控件指定滚动条。

声明性语法

<asp:Panel
    AccessKey="string"
    BackColor="color name|#dddddd"
    BackImageUrl="uri"
    BorderColor="color name|#dddddd"
    BorderStyle="NotSet|None|Dotted|Dashed|Solid|Double|Groove|Ridge|
        Inset|Outset"
    BorderWidth="size"
    CssClass="string"
    DefaultButton="string"
    Direction="NotSet|LeftToRight|RightToLeft"
    Enabled="True|False"
    EnableTheming="True|False"
    EnableViewState="True|False"
    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"
    GroupingText="string"
    Height="size"
    HorizontalAlign="NotSet|Left|Center|Right|Justify"
    ID="string"
    OnDataBinding="DataBinding event handler"
    OnDisposed="Disposed event handler"
    OnInit="Init event handler"
    OnLoad="Load event handler"
    OnPreRender="PreRender event handler"
    OnUnload="Unload event handler"
    runat="server"
    ScrollBars="None|Horizontal|Vertical|Both|Auto"
    SkinID="string"
    Style="string"
    TabIndex="integer"
    ToolTip="string"
    Visible="True|False"
    Width="size"
    Wrap="True|False"
/>

构造函数

名称 说明
Panel()

初始化 Panel 类的新实例。

属性

名称 说明
AccessKey

获取或设置访问密钥,使你能够快速导航到 Web 服务器控件。

(继承自 WebControl)
Adapter

获取控件的特定于浏览器的适配器。

(继承自 Control)
AppRelativeTemplateSourceDirectory

获取或设置包含此控件的 PageUserControl 对象的应用程序相对虚拟目录。

(继承自 Control)
Attributes

获取不对应于控件上的属性的任意属性(仅用于呈现)的集合。

(继承自 WebControl)
BackColor

获取或设置 Web 服务器控件的背景色。

(继承自 WebControl)
BackImageUrl

获取或设置面板控件的背景图像的 URL。

BindingContainer

获取包含此控件的数据绑定的控件。

(继承自 Control)
BorderColor

获取或设置 Web 控件的边框颜色。

(继承自 WebControl)
BorderStyle

获取或设置 Web 服务器控件的边框样式。

(继承自 WebControl)
BorderWidth

获取或设置 Web 服务器控件的边框宽度。

(继承自 WebControl)
ChildControlsCreated

获取一个值,该值指示是否已创建服务器控件的子控件。

(继承自 Control)
ClientID

获取由 ASP.NET 生成的 HTML 标记的控件 ID。

(继承自 Control)
ClientIDMode

获取或设置用于生成属性值的 ClientID 算法。

(继承自 Control)
ClientIDSeparator

获取一个表示属性中使用的 ClientID 分隔符的字符值。

(继承自 Control)
Context

HttpContext获取与当前 Web 请求的服务器控件关联的对象。

(继承自 Control)
Controls

获取一个 ControlCollection 对象,该对象代表 UI 层次结构中指定服务器控件的子控件。

(继承自 Control)
ControlStyle

获取 Web 服务器控件的样式。 此属性主要由控件开发人员使用。

(继承自 WebControl)
ControlStyleCreated

获取一个值,该值 Style 指示是否已为 ControlStyle 属性创建对象。 此属性主要由控件开发人员使用。

(继承自 WebControl)
CssClass

获取或设置由客户端上的 Web 服务器控件呈现的级联样式表 (CSS) 类。

(继承自 WebControl)
DataItemContainer

获取对命名容器的引用(如果命名容器实现 IDataItemContainer)。

(继承自 Control)
DataKeysContainer

获取对命名容器的引用(如果命名容器实现 IDataKeysControl)。

(继承自 Control)
DefaultButton

获取或设置控件中包含的默认按钮的 Panel 标识符。

DesignMode

获取一个值,该值指示控件是否在设计图面上使用。

(继承自 Control)
Direction

获取或设置显示控件中包含 Panel 文本的控件的方向。

Enabled

获取或设置一个值,该值指示是否启用 Web 服务器控件。

(继承自 WebControl)
EnableTheming

获取或设置一个值,该值指示主题是否应用于此控件。

(继承自 WebControl)
EnableViewState

获取或设置一个值,该值指示服务器控件是否将视图状态及其包含的任何子控件的视图状态保存到请求客户端。

(继承自 Control)
Events

获取控件的事件处理程序委托的列表。 此属性为只读。

(继承自 Control)
Font

获取与 Web 服务器控件关联的字体属性。

(继承自 WebControl)
ForeColor

获取或设置 Web 服务器控件的前景色(通常是文本的颜色)。

(继承自 WebControl)
GroupingText

获取或设置面板控件中包含的控件组的标题。

HasAttributes

获取一个值,该值指示控件是否设置了属性。

(继承自 WebControl)
HasChildViewState

获取一个值,该值指示当前服务器控件的子控件是否具有保存的视图状态设置。

(继承自 Control)
Height

获取或设置 Web 服务器控件的高度。

(继承自 WebControl)
HorizontalAlign

获取或设置面板中内容的水平对齐方式。

ID

获取或设置分配给服务器控件的编程标识符。

(继承自 Control)
IdSeparator

获取用于分隔控件标识符的字符。

(继承自 Control)
IsChildControlStateCleared

获取一个值,该值指示此控件中包含的控件是否具有控件状态。

(继承自 Control)
IsEnabled

获取一个值,该值指示是否启用控件。

(继承自 WebControl)
IsTrackingViewState

获取一个值,该值指示服务器控件是否正在保存对其视图状态的更改。

(继承自 Control)
IsViewStateEnabled

获取一个值,该值指示是否为此控件启用视图状态。

(继承自 Control)
LoadViewStateByID

获取一个值,该值指示控件是否参与加载其视图状态,而不是 ID 索引。

(继承自 Control)
NamingContainer

获取对服务器控件命名容器的引用,该容器创建唯一的命名空间,用于区分具有相同 ID 属性值的服务器控件。

(继承自 Control)
Page

获取对 Page 包含服务器控件的实例的引用。

(继承自 Control)
Parent

获取对页面控件层次结构中服务器控件的父控件的引用。

(继承自 Control)
RenderingCompatibility

获取一个值,该值指定呈现的 HTML 将与 ASP.NET 版本兼容。

(继承自 Control)
ScrollBars

获取或设置控件中 Panel 滚动条的可见性和位置。

Site

获取有关在设计图面上呈现时承载当前控件的容器的信息。

(继承自 Control)
SkinID

获取或设置要应用于控件的皮肤。

(继承自 WebControl)
Style

获取文本属性的集合,该属性将在 Web 服务器控件的外部标记上呈现为样式属性。

(继承自 WebControl)
SupportsDisabledAttribute

获取一个值,该值指示当控件的属性为控件的属性时,控件是否应将呈现的 IsEnabled HTML 元素的属性false设置为disabled“disabled”。

TabIndex

获取或设置 Web 服务器控件的选项卡索引。

(继承自 WebControl)
TagKey

HtmlTextWriterTag获取与此 Web 服务器控件对应的值。 此属性主要由控件开发人员使用。

(继承自 WebControl)
TagName

获取控件标记的名称。 此属性主要由控件开发人员使用。

(继承自 WebControl)
TemplateControl

获取或设置对包含此控件的模板的引用。

(继承自 Control)
TemplateSourceDirectory

获取包含当前服务器控件的 Page 虚拟 UserControl 目录。

(继承自 Control)
ToolTip

获取或设置鼠标指针悬停在 Web 服务器控件上时显示的文本。

(继承自 WebControl)
UniqueID

获取服务器控件的唯一分层限定标识符。

(继承自 Control)
ValidateRequestMode

获取或设置一个值,该值指示控件是否检查浏览器的客户端输入是否存在潜在危险值。

(继承自 Control)
ViewState

获取状态信息的字典,该字典允许跨同一页的多个请求保存和还原服务器控件的视图状态。

(继承自 Control)
ViewStateIgnoresCase

获取一个值,该值指示对象是否 StateBag 不区分大小写。

(继承自 Control)
ViewStateMode

获取或设置此控件的视图状态模式。

(继承自 Control)
Visible

获取或设置一个值,该值指示服务器控件是否呈现为页面上的 UI。

(继承自 Control)
Width

获取或设置 Web 服务器控件的宽度。

(继承自 WebControl)
Wrap

获取或设置一个值,该值指示内容是否包装在面板中。

方法

名称 说明
AddAttributesToRender(HtmlTextWriter)

向要呈现的属性列表添加有关背景图像、对齐、环绕和方向的信息。

AddedControl(Control, Int32)

在将子控件添加到 Controls 对象的集合 Control 后调用。

(继承自 Control)
AddParsedSubObject(Object)

通知服务器控件对元素(XML 或 HTML)进行了分析,并将该元素添加到服务器控件的对象 ControlCollection

(继承自 Control)
ApplyStyle(Style)

将指定样式的任何非空白元素复制到 Web 控件,覆盖该控件的任何现有样式元素。 此方法主要由控件开发人员使用。

(继承自 WebControl)
ApplyStyleSheetSkin(Page)

将页面样式表中定义的样式属性应用于控件。

(继承自 Control)
BeginRenderTracing(TextWriter, Object)

开始对呈现数据进行设计时跟踪。

(继承自 Control)
BuildProfileTree(String, Boolean)

收集有关服务器控件的信息,并将其传送到 Trace 为页面启用跟踪时要显示的属性。

(继承自 Control)
ClearCachedClientID()

将缓存 ClientID 的值设置为 null

(继承自 Control)
ClearChildControlState()

删除服务器控件的子控件的控件状态信息。

(继承自 Control)
ClearChildState()

删除所有服务器控件的子控件的视图状态和控件状态信息。

(继承自 Control)
ClearChildViewState()

删除所有服务器控件的子控件的视图状态信息。

(继承自 Control)
ClearEffectiveClientIDMode()

ClientIDMode 当前控件实例的属性和任何子控件的属性设置为 Inherit

(继承自 Control)
CopyBaseAttributes(WebControl)

将对象未封装 Style 的属性从指定的 Web 服务器控件复制到从中调用此方法的 Web 服务器控件。 此方法主要由控件开发人员使用。

(继承自 WebControl)
CreateChildControls()

ASP.NET 页面框架调用,以通知使用基于组合的实现创建任何子控件的服务器控件,以准备回发或呈现。

(继承自 Control)
CreateControlCollection()

创建一个新 ControlCollection 对象,用于保存服务器控件的子控件(文本控件和服务器)。

(继承自 Control)
CreateControlStyle()

创建控件在内部用于实现所有样式相关属性的 Panel 样式对象。

CreateControlStyle()

创建类在内部用于实现所有样式相关属性的 WebControl 样式对象。 此方法主要由控件开发人员使用。

(继承自 WebControl)
DataBind()

将数据源绑定到调用的服务器控件及其所有子控件。

(继承自 Control)
DataBind(Boolean)

将数据源绑定到已调用的服务器控件及其所有子控件,并提供引发 DataBinding 事件的选项。

(继承自 Control)
DataBindChildren()

将数据源绑定到服务器控件的子控件。

(继承自 Control)
Dispose()

使服务器控件能够在从内存释放之前执行最终清理。

(继承自 Control)
EndRenderTracing(TextWriter, Object)

结束呈现数据的设计时跟踪。

(继承自 Control)
EnsureChildControls()

确定服务器控件是否包含子控件。 如果没有,它将创建子控件。

(继承自 Control)
EnsureID()

为未分配标识符的控件创建标识符。

(继承自 Control)
Equals(Object)

确定指定的对象是否等于当前对象。

(继承自 Object)
FindControl(String, Int32)

在当前命名容器中搜索具有指定 id 和整数的服务器控件(在参数中指定的 pathOffset 整数),这有助于搜索。 不应重写此方法的 FindControl 此版本。

(继承自 Control)
FindControl(String)

使用指定 id 参数搜索服务器控件的当前命名容器。

(继承自 Control)
Focus()

将输入焦点设置为控件。

(继承自 Control)
GetDesignModeState()

获取控件的设计时数据。

(继承自 Control)
GetHashCode()

用作默认哈希函数。

(继承自 Object)
GetRouteUrl(Object)

获取对应于一组路由参数的 URL。

(继承自 Control)
GetRouteUrl(RouteValueDictionary)

获取对应于一组路由参数的 URL。

(继承自 Control)
GetRouteUrl(String, Object)

获取对应于一组路由参数和路由名称的 URL。

(继承自 Control)
GetRouteUrl(String, RouteValueDictionary)

获取对应于一组路由参数和路由名称的 URL。

(继承自 Control)
GetType()

获取当前实例的 Type

(继承自 Object)
GetUniqueIDRelativeTo(Control)

返回指定控件属性的前缀部分 UniqueID

(继承自 Control)
HasControls()

确定服务器控件是否包含任何子控件。

(继承自 Control)
HasEvents()

返回一个值,该值指示是为控件或任何子控件注册事件。

(继承自 Control)
IsLiteralContent()

确定服务器控件是否仅保留文本内容。

(继承自 Control)
LoadControlState(Object)

从方法保存 SaveControlState() 的上一页请求中还原控件状态信息。

(继承自 Control)
LoadViewState(Object)

从使用该方法保存 SaveViewState() 的上一个请求还原视图状态信息。

(继承自 WebControl)
MapPathSecure(String)

检索虚拟路径映射到的物理路径(绝对路径或相对路径)。

(继承自 Control)
MemberwiseClone()

创建当前 Object的浅表副本。

(继承自 Object)
MergeStyle(Style)

将指定样式的任何非空白元素复制到 Web 控件,但不会覆盖该控件的任何现有样式元素。 此方法主要由控件开发人员使用。

(继承自 WebControl)
OnBubbleEvent(Object, EventArgs)

确定服务器控件的事件是否传递页面的 UI 服务器控件层次结构。

(继承自 Control)
OnDataBinding(EventArgs)

引发 DataBinding 事件。

(继承自 Control)
OnInit(EventArgs)

引发 Init 事件。

(继承自 Control)
OnLoad(EventArgs)

引发 Load 事件。

(继承自 Control)
OnPreRender(EventArgs)

引发 PreRender 事件。

(继承自 Control)
OnUnload(EventArgs)

引发 Unload 事件。

(继承自 Control)
OpenFile(String)

获取用于读取文件的一个 Stream

(继承自 Control)
RaiseBubbleEvent(Object, EventArgs)

将事件的任何源及其信息分配给控件的父级。

(继承自 Control)
RemovedControl(Control)

Controls 对象的集合 Control 中删除子控件后调用。

(继承自 Control)
Render(HtmlTextWriter)

将控件呈现到指定的 HTML 编写器。

(继承自 WebControl)
RenderBeginTag(HtmlTextWriter)

将控件的 Panel HTML 开始标记呈现给指定的编写器。

RenderBeginTag(HtmlTextWriter)

将控件的 HTML 开始标记呈现给指定的编写器。 此方法主要由控件开发人员使用。

(继承自 WebControl)
RenderChildren(HtmlTextWriter)

将服务器控件的子级的内容输出到所提供的 HtmlTextWriter 对象,该对象写入要呈现在客户端上的内容。

(继承自 Control)
RenderContents(HtmlTextWriter)

将控件的内容呈现给指定的编写器。 此方法主要由控件开发人员使用。

(继承自 WebControl)
RenderControl(HtmlTextWriter, ControlAdapter)

使用提供的对象将服务器控件内容输出到所提供的HtmlTextWriterControlAdapter对象。

(继承自 Control)
RenderControl(HtmlTextWriter)

将服务器控件内容输出到提供 HtmlTextWriter 的对象,并在启用跟踪时存储有关控件的跟踪信息。

(继承自 Control)
RenderEndTag(HtmlTextWriter)

将控件的 Panel HTML 结束标记呈现到指定的编写器中。

RenderEndTag(HtmlTextWriter)

将控件的 HTML 结束标记呈现到指定的编写器中。 此方法主要由控件开发人员使用。

(继承自 WebControl)
ResolveAdapter()

获取负责呈现指定控件的控件适配器。

(继承自 Control)
ResolveClientUrl(String)

获取浏览器可以使用的 URL。

(继承自 Control)
ResolveUrl(String)

将 URL 转换为在请求客户端上可用 URL。

(继承自 Control)
SaveControlState()

保存自页面发回服务器后发生的任何服务器控件状态更改。

(继承自 Control)
SaveViewState()

保存调用方法后 TrackViewState() 修改的任何状态。

(继承自 WebControl)
SetDesignModeState(IDictionary)

设置控件的设计时数据。

(继承自 Control)
SetRenderMethodDelegate(RenderMethod)

分配事件处理程序委托以将服务器控件及其内容呈现为其父控件。

(继承自 Control)
SetTraceData(Object, Object, Object)

使用跟踪对象、跟踪数据键和跟踪数据值为呈现数据的设计时跟踪设置跟踪数据。

(继承自 Control)
SetTraceData(Object, Object)

使用跟踪数据键和跟踪数据值为呈现数据的设计时跟踪设置跟踪数据。

(继承自 Control)
ToString()

返回一个表示当前对象的字符串。

(继承自 Object)
TrackViewState()

使控件跟踪其视图状态的更改,以便这些更改可以存储在对象的 ViewState 属性中。

(继承自 WebControl)

活动

名称 说明
DataBinding

当服务器控件绑定到数据源时发生。

(继承自 Control)
Disposed

在从内存中释放服务器控件时发生,这是请求 ASP.NET 页时服务器控件生命周期的最后阶段。

(继承自 Control)
Init

在初始化服务器控件时发生,这是其生命周期中的第一步。

(继承自 Control)
Load

在将服务器控件加载到对象中 Page 时发生。

(继承自 Control)
PreRender

Control 加载对象但在呈现之前发生。

(继承自 Control)
Unload

从内存中卸载服务器控件时发生。

(继承自 Control)

显式接口实现

名称 说明
IAttributeAccessor.GetAttribute(String)

获取具有指定名称的 Web 控件的属性。

(继承自 WebControl)
IAttributeAccessor.SetAttribute(String, String)

将 Web 控件的属性设置为指定的名称和值。

(继承自 WebControl)
IControlBuilderAccessor.ControlBuilder

有关此成员的说明,请参阅 ControlBuilder

(继承自 Control)
IControlDesignerAccessor.GetDesignModeState()

有关此成员的说明,请参阅 GetDesignModeState()

(继承自 Control)
IControlDesignerAccessor.SetDesignModeState(IDictionary)

有关此成员的说明,请参阅 SetDesignModeState(IDictionary)

(继承自 Control)
IControlDesignerAccessor.SetOwnerControl(Control)

有关此成员的说明,请参阅 SetOwnerControl(Control)

(继承自 Control)
IControlDesignerAccessor.UserData

有关此成员的说明,请参阅 UserData

(继承自 Control)
IDataBindingsAccessor.DataBindings

有关此成员的说明,请参阅 DataBindings

(继承自 Control)
IDataBindingsAccessor.HasDataBindings

有关此成员的说明,请参阅 HasDataBindings

(继承自 Control)
IExpressionsAccessor.Expressions

有关此成员的说明,请参阅 Expressions

(继承自 Control)
IExpressionsAccessor.HasExpressions

有关此成员的说明,请参阅 HasExpressions

(继承自 Control)
IParserAccessor.AddParsedSubObject(Object)

有关此成员的说明,请参阅 AddParsedSubObject(Object)

(继承自 Control)

扩展方法

名称 说明
FindDataSourceControl(Control)

返回与指定控件的数据控件关联的数据源。

FindFieldTemplate(Control, String)

返回指定控件命名容器中指定列的字段模板。

FindMetaTable(Control)

返回包含数据控件的元表对象。

适用于

另请参阅