HierarchicalDataSourceControl Класс
Определение
Предоставляет базовый класс для элементов управления источниками данных, представляющих иерархические данные.Provides a base class for data source controls that represent hierarchical data.
public ref class HierarchicalDataSourceControl abstract : System::Web::UI::Control, System::Web::UI::IHierarchicalDataSource
[System.ComponentModel.Bindable(false)]
public abstract class HierarchicalDataSourceControl : System.Web.UI.Control, System.Web.UI.IHierarchicalDataSource
type HierarchicalDataSourceControl = class
inherit Control
interface IHierarchicalDataSource
Public MustInherit Class HierarchicalDataSourceControl
Inherits Control
Implements IHierarchicalDataSource
- Наследование
- Производный
- Атрибуты
- Реализации
Примеры
В следующем примере кода показано, как расширить абстрактный HierarchicalDataSourceControl класс HierarchicalDataSourceView и IHierarchicalEnumerable класс, а также реализовать интерфейсы и IHierarchyData для создания иерархического элемента управления источниками данных, который получает файловую систему. об.The following code example demonstrates how to extend the abstract HierarchicalDataSourceControl class and the HierarchicalDataSourceView class, and implement the IHierarchicalEnumerable and IHierarchyData interfaces to create a hierarchical data source control that retrieves file system information. Элемент управления позволяет элементам управления веб-сервера выполнять FileSystemInfo привязку к объектам и отображать основные сведения о файловой системе. FileSystemDataSource
The FileSystemDataSource
control enables Web server controls to bind to FileSystemInfo objects and display basic file system information. Класс в примере предоставляет реализацию GetHierarchicalView FileSystemDataSourceView
метода, который извлекает объект. FileSystemDataSource
The FileSystemDataSource
class in the example provides the implementation of the GetHierarchicalView method, which retrieves a FileSystemDataSourceView
object. FileSystemDataSourceView
Объект получает данные из базового хранилища данных, в данном случае сведения о файловой системе на веб-сервере.The FileSystemDataSourceView
object retrieves the data from the underlying data storage, in this case the file system information on the Web server. В целях безопасности сведения о файловой системе отображаются только в том случае, если элемент управления источника данных используется в локальном узле, прошедшем проверку подлинности сценарии и начинается с виртуального каталога, в котором находится страница веб-форм, использующая элемент управления источниками данных.For security purposes, file system information is displayed only if the data source control is being used in a localhost, authenticated scenario, and only starts with the virtual directory that the Web Forms page using the data source control resides in. Наконец, два класса IHierarchicalEnumerable , реализующие IHierarchyData и, предоставляются для упаковки FileSystemInfo объектов, FileSystemDataSource
использующих.Finally, two classes that implement IHierarchicalEnumerable and IHierarchyData are provided to wrap the FileSystemInfo objects that FileSystemDataSource
uses.
using System;
using System.Collections;
using System.IO;
using System.Runtime.InteropServices;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public class FileSystemDataSource :
HierarchicalDataSourceControl, IHierarchicalDataSource
{
private FileSystemDataSourceView view = null;
public FileSystemDataSource() : base() { }
protected override HierarchicalDataSourceView
GetHierarchicalView(string viewPath)
{
view = new FileSystemDataSourceView(viewPath);
return view;
}
}
public class FileSystemDataSourceView : HierarchicalDataSourceView
{
private string _viewPath;
public FileSystemDataSourceView(string viewPath)
{
HttpRequest currentRequest = HttpContext.Current.Request;
if (viewPath == "")
{
_viewPath = currentRequest.MapPath(currentRequest.ApplicationPath);
}
else
{
_viewPath = Path.Combine(
currentRequest.MapPath(currentRequest.ApplicationPath),
viewPath);
}
}
// Starting with the rootNode, recursively build a list of
// FileSystemInfo nodes, create FileSystemHierarchyData
// objects, add them all to the FileSystemHierarchicalEnumerable,
// and return the list.
public override IHierarchicalEnumerable Select()
{
HttpRequest currentRequest = HttpContext.Current.Request;
// SECURITY: There are many security issues that can be raised
// SECURITY: by exposing the file system structure of a Web server
// SECURITY: to an anonymous user in a limited trust scenario such as
// SECURITY: a Web page served on an intranet or the Internet.
// SECURITY: For this reason, the FileSystemDataSource only
// SECURITY: shows data when the HttpRequest is received
// SECURITY: from a local Web server. In addition, the data source
// SECURITY: does not display data to anonymous users.
if (currentRequest.IsAuthenticated &&
(currentRequest.UserHostAddress == "127.0.0.1" ||
currentRequest.UserHostAddress == "::1"))
{
DirectoryInfo rootDirectory = new DirectoryInfo(_viewPath);
if (!rootDirectory.Exists)
{
return null;
}
FileSystemHierarchicalEnumerable fshe =
new FileSystemHierarchicalEnumerable();
foreach (FileSystemInfo fsi
in rootDirectory.GetFileSystemInfos())
{
fshe.Add(new FileSystemHierarchyData(fsi));
}
return fshe;
}
else
{
throw new NotSupportedException(
"The FileSystemDataSource only " +
"presents data in an authenticated, localhost context.");
}
}
}
// A collection of FileSystemHierarchyData objects
public class FileSystemHierarchicalEnumerable :
ArrayList, IHierarchicalEnumerable
{
public FileSystemHierarchicalEnumerable()
: base()
{
}
public IHierarchyData GetHierarchyData(object enumeratedItem)
{
return enumeratedItem as IHierarchyData;
}
}
public class FileSystemHierarchyData : IHierarchyData
{
private FileSystemInfo fileSystemObject = null;
public FileSystemHierarchyData(FileSystemInfo obj)
{
fileSystemObject = obj;
}
public override string ToString()
{
return fileSystemObject.Name;
}
// IHierarchyData implementation.
public bool HasChildren
{
get
{
if (typeof(DirectoryInfo) == fileSystemObject.GetType())
{
DirectoryInfo temp = (DirectoryInfo)fileSystemObject;
return (temp.GetFileSystemInfos().Length > 0);
}
else return false;
}
}
// DirectoryInfo returns the OriginalPath, while FileInfo returns
// a fully qualified path.
public string Path
{
get
{
return fileSystemObject.ToString();
}
}
public object Item
{
get
{
return fileSystemObject;
}
}
public string Type
{
get
{
return "FileSystemData";
}
}
public IHierarchicalEnumerable GetChildren()
{
FileSystemHierarchicalEnumerable children =
new FileSystemHierarchicalEnumerable();
if (typeof(DirectoryInfo) == fileSystemObject.GetType())
{
DirectoryInfo temp = (DirectoryInfo)fileSystemObject;
foreach (FileSystemInfo fsi in temp.GetFileSystemInfos())
{
children.Add(new FileSystemHierarchyData(fsi));
}
}
return children;
}
public IHierarchyData GetParent()
{
FileSystemHierarchicalEnumerable parentContainer =
new FileSystemHierarchicalEnumerable();
if (typeof(DirectoryInfo) == fileSystemObject.GetType())
{
DirectoryInfo temp = (DirectoryInfo)fileSystemObject;
return new FileSystemHierarchyData(temp.Parent);
}
else if (typeof(FileInfo) == fileSystemObject.GetType())
{
FileInfo temp = (FileInfo)fileSystemObject;
return new FileSystemHierarchyData(temp.Directory);
}
// If FileSystemObj is any other kind of FileSystemInfo, ignore it.
return null;
}
}
Imports System.Collections
Imports System.IO
Imports System.Runtime.InteropServices
Imports System.Security.Permissions
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Namespace Samples.AspNet
Public Class FileSystemDataSource
Inherits HierarchicalDataSourceControl
Public Sub New()
End Sub
Private view As FileSystemDataSourceView = Nothing
Protected Overrides Function GetHierarchicalView( _
ByVal viewPath As String) As HierarchicalDataSourceView
view = New FileSystemDataSourceView(viewPath)
Return view
End Function
End Class
Public Class FileSystemDataSourceView
Inherits HierarchicalDataSourceView
Private _viewPath As String
Public Sub New(ByVal viewPath As String)
Dim currentRequest As HttpRequest = HttpContext.Current.Request
If viewPath = "" Then
_viewPath = currentRequest.MapPath(currentRequest.ApplicationPath)
Else
_viewPath = Path.Combine(currentRequest.MapPath(currentRequest.ApplicationPath), viewPath)
End If
End Sub
' Starting with the rootNode, recursively build a list of
' FileSystemInfo nodes, create FileSystemHierarchyData
' objects, add them all to the FileSystemHierarchicalEnumerable,
' and return the list.
Public Overrides Function [Select]() As IHierarchicalEnumerable
Dim currentRequest As HttpRequest = HttpContext.Current.Request
' SECURITY: There are many security issues that can be raised
' SECURITY: by exposing the file system structure of a Web server
' SECURITY: to an anonymous user in a limited trust scenario such as
' SECURITY: a Web page served on an intranet or the Internet.
' SECURITY: For this reason, the FileSystemDataSource only
' SECURITY: shows data when the HttpRequest is received
' SECURITY: from a local Web server. In addition, the data source
' SECURITY: does not display data to anonymous users.
If currentRequest.IsAuthenticated AndAlso _
(currentRequest.UserHostAddress = "127.0.0.1" OrElse _
currentRequest.UserHostAddress = "::1") Then
Dim rootDirectory As New DirectoryInfo(_viewPath)
Dim fshe As New FileSystemHierarchicalEnumerable()
Dim fsi As FileSystemInfo
For Each fsi In rootDirectory.GetFileSystemInfos()
fshe.Add(New FileSystemHierarchyData(fsi))
Next fsi
Return fshe
Else
Throw New NotSupportedException( _
"The FileSystemDataSource only " + _
"presents data in an authenticated, localhost context.")
End If
End Function 'Select
End Class
Public Class FileSystemHierarchicalEnumerable
Inherits ArrayList
Implements IHierarchicalEnumerable
Public Sub New()
End Sub
Public Overridable Function GetHierarchyData( _
ByVal enumeratedItem As Object) As IHierarchyData _
Implements IHierarchicalEnumerable.GetHierarchyData
Return CType(enumeratedItem, IHierarchyData)
End Function
End Class
Public Class FileSystemHierarchyData
Implements IHierarchyData
Public Sub New(ByVal obj As FileSystemInfo)
fileSystemObject = obj
End Sub
Private fileSystemObject As FileSystemInfo = Nothing
Public Overrides Function ToString() As String
Return fileSystemObject.Name
End Function
' IHierarchyData implementation.
Public Overridable ReadOnly Property HasChildren() As Boolean _
Implements IHierarchyData.HasChildren
Get
If GetType(DirectoryInfo) Is fileSystemObject.GetType() Then
Dim temp As DirectoryInfo = _
CType(fileSystemObject, DirectoryInfo)
Return temp.GetFileSystemInfos().Length > 0
Else
Return False
End If
End Get
End Property
' DirectoryInfo returns the OriginalPath, while FileInfo returns
' a fully qualified path.
Public Overridable ReadOnly Property Path() As String _
Implements IHierarchyData.Path
Get
Return fileSystemObject.ToString()
End Get
End Property
Public Overridable ReadOnly Property Item() As Object _
Implements IHierarchyData.Item
Get
Return fileSystemObject
End Get
End Property
Public Overridable ReadOnly Property Type() As String _
Implements IHierarchyData.Type
Get
Return "FileSystemData"
End Get
End Property
Public Overridable Function GetChildren() _
As IHierarchicalEnumerable _
Implements IHierarchyData.GetChildren
Dim children As New FileSystemHierarchicalEnumerable()
If GetType(DirectoryInfo) Is fileSystemObject.GetType() Then
Dim temp As DirectoryInfo = _
CType(fileSystemObject, DirectoryInfo)
Dim fsi As FileSystemInfo
For Each fsi In temp.GetFileSystemInfos()
children.Add(New FileSystemHierarchyData(fsi))
Next fsi
End If
Return children
End Function 'GetChildren
Public Overridable Function GetParent() As IHierarchyData _
Implements IHierarchyData.GetParent
Dim parentContainer As New FileSystemHierarchicalEnumerable()
If GetType(DirectoryInfo) Is fileSystemObject.GetType() Then
Dim temp As DirectoryInfo = _
CType(fileSystemObject, DirectoryInfo)
Return New FileSystemHierarchyData(temp.Parent)
ElseIf GetType(FileInfo) Is fileSystemObject.GetType() Then
Dim temp As FileInfo = CType(fileSystemObject, FileInfo)
Return New FileSystemHierarchyData(temp.Directory)
End If
' If FileSystemObj is any other kind of FileSystemInfo, ignore it.
Return Nothing
End Function 'GetParent
End Class
End Namespace
В следующем примере кода показано, как декларативно привязать TreeView элемент управления к данным файловой системы, FileSystemDataSource
используя пример.The following code example demonstrates how to declaratively bind a TreeView control to file system data using the FileSystemDataSource
example.
<%@ Page Language="C#" %>
<%@ Register Tagprefix="aspSample" Namespace="Samples.AspNet" %>
<!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>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:treeview
id="TreeView1"
runat="server"
datasourceid="FileSystemDataSource1" />
<aspSample:filesystemdatasource
id = "FileSystemDataSource1"
runat = "server" />
</form>
</body>
</html>
<%@ Page Language="VB" %>
<%@ Register Tagprefix="aspSample" Namespace="Samples.AspNet" %>
<!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>ASP.NET Example</title>
</head>
<body>
<form id="form1" runat="server">
<asp:treeview
id="TreeView1"
runat="server"
datasourceid="FileSystemDataSource1" />
<aspSample:filesystemdatasource
id = "FileSystemDataSource1"
runat = "server" />
</form>
</body>
</html>
Комментарии
ASP.NET поддерживает архитектуру привязки данных элементов управления, которая позволяет серверным веб-элементам управления выполнять привязку к данным и представлять их единообразно.ASP.NET supports a controls data-binding architecture that enables Web server controls to bind to data and present it in a consistent fashion. Веб-серверные элементы управления, привязанные к данным, называются элементами управления с привязкой к данным, а классы, упрощающие привязку, называются элементами управления источниками данных.Web server controls that bind to data are called data-bound controls, and the classes that facilitate binding are called data source controls. Элементы управления источниками данных могут представлять любой источник данных: файл, поток, реляционную базу данных, бизнес-объект и т. д.Data source controls can represent any data source: a file, a stream, a relational database, a business object, and so on. Элементы управления источниками данных представляют данные единообразно для элементов управления, привязанных к данным, независимо от источника или формата базовых данных.Data source controls present data in a consistent way to data-bound controls, regardless of the source or format of the underlying data.
Элементы управления источниками данных, представляющие иерархические данные HierarchicalDataSourceControl , являются производными от класса, а элементы управления источниками данных, представляющие списки DataSourceControl или таблицы данных, являются производными от класса.Data source controls that represent hierarchical data derive from the HierarchicalDataSourceControl class, while data source controls that represent lists or tables of data derive from the DataSourceControl class. Класс является базовой реализацией IHierarchicalDataSource интерфейса, который определяет один метод для получения иерархических объектов представлений источников данных, GetHierarchicalViewсвязанных с элементом управления источником данных. HierarchicalDataSourceControlThe HierarchicalDataSourceControl class is the base implementation of the IHierarchicalDataSource interface, which defines a single method to retrieve hierarchical data source view objects associated with the data source control, GetHierarchicalView.
Элемент управления источниками данных можно представить как сочетание HierarchicalDataSourceControl объекта и связанных с ним представлений базовых данных, называемых объектами представления источников данных.You can think of a data source control as the combination of the HierarchicalDataSourceControl object and its associated views on the underlying data, called data source view objects. Хотя элементы управления источниками данных, представляющими табличные данные, обычно связаны только с одним HierarchicalDataSourceControl именованным представлением, класс поддерживает представление источника данных для каждого уровня иерархических данных, представляемых элементом управления источниками данных.While data source controls that represent tabular data are typically associated with only one named view, the HierarchicalDataSourceControl class supports a data source view for each level of hierarchical data that the data source control represents. Уровень иерархических данных определяется уникальным иерархическим путем, передаваемым GetHierarchicalView в метод viewPath
в параметре.The level of hierarchical data is identified by a unique hierarchical path, passed to the GetHierarchicalView method in the viewPath
parameter. Каждый HierarchicalDataSourceView объект определяет возможности элемента управления источниками данных для представленного иерархического уровня и выполняет такие операции, как вставка, обновление, удаление и сортировка.Each HierarchicalDataSourceView object defines the capabilities of a data source control for the hierarchical level represented, and performs operations such as insert, update, delete, and sort.
Элементы управления веб-сервера, производные HierarchicalDataBoundControl от класса, такие TreeViewкак, используют иерархические элементы управления источниками данных для привязки к иерархическим данным.Web server controls that derive from the HierarchicalDataBoundControl class, such as TreeView, use hierarchical data source controls to bind to hierarchical data.
Элементы управления источниками данных реализуются как элементы управления, чтобы включить декларативное сохранение и при необходимости разрешить участие в управлении состоянием.Data source controls are implemented as controls to enable declarative persistence and to optionally permit participation in state management. Элементы управления источниками данных не имеют визуальной визуализации и поэтому не поддерживают темы.Data source controls have no visual rendering, and therefore do not support themes.
Конструкторы
HierarchicalDataSourceControl() |
Инициализирует новый экземпляр класса HierarchicalDataSourceControl.Initializes a new instance of the HierarchicalDataSourceControl class. |
Свойства
Adapter |
Возвращает конкретный адаптер браузера для элемента управления.Gets the browser-specific adapter for the control. (Унаследовано от Control) |
AppRelativeTemplateSourceDirectory |
Возвращает или задает относительно приложения виртуальный каталог объекта Page или UserControl, который содержит этот элемент управления.Gets or sets the application-relative virtual directory of the Page or UserControl object that contains this control. (Унаследовано от Control) |
BindingContainer |
Возвращает элемент управления, который содержит привязку данных элемента управления.Gets the control that contains this control's data binding. (Унаследовано от Control) |
ChildControlsCreated |
Возвращает значение, которое указывает, созданы ли дочерние элементы управления серверного элемента управления.Gets a value that indicates whether the server control's child controls have been created. (Унаследовано от Control) |
ClientID |
Возвращает идентификатор серверного элемента управления, созданный ASP.NET.Gets the server control identifier generated by ASP.NET. |
ClientIDMode |
Это свойство не используется для элементов управления источником данных.This property is not used for data source controls. |
ClientIDSeparator |
Возвращает значение символа разделителя, используемого в свойстве ClientID.Gets a character value representing the separator character used in the ClientID property. (Унаследовано от Control) |
Context |
Возвращает объект HttpContext, связанный с серверным элементом управления для текущего веб-запроса.Gets the HttpContext object associated with the server control for the current Web request. (Унаследовано от Control) |
Controls |
Возвращает объект ControlCollection, который представляет дочерние элементы управления для указанного элемента управления сервера в иерархии пользовательского интерфейса.Gets a ControlCollection object that represents the child controls for a specified server control in the UI hierarchy. |
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) |
EnableTheming |
Возвращает значение, указывающее, поддерживает ли данный элемент управления темы.Gets a value indicating whether this control supports themes. |
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 |
Возвращает список делегатов обработчиков событий элемента управления.Gets a list of event handler delegates for the control. Это свойство доступно только для чтения.This property is read-only. (Унаследовано от Control) |
HasChildViewState |
Возвращает значение, которое указывает на наличие сохраненных параметров состояния представления у дочернего элемента серверного элемента управления.Gets a value indicating whether the current server control's child controls have any saved view-state settings. (Унаследовано от Control) |
ID |
Возвращает или задает программный идентификатор, назначенный серверному элементу управления.Gets or sets the programmatic identifier assigned to the server control. (Унаследовано от Control) |
IdSeparator |
Возвращает символ, используемый для разделения идентификаторов элементов управления.Gets the character used to separate control identifiers. (Унаследовано от Control) |
IsChildControlStateCleared |
Возвращает значение, указывающее, имеют ли элементы управления в этом элементе управления состояние элемента управления.Gets a value indicating whether controls contained within this control have control state. (Унаследовано от Control) |
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) |
LoadViewStateByID |
Возвращает значение, указывающее, участвует ли элемент управления в загрузке состояния представления ID вместо индекса.Gets a value indicating whether the control participates in loading its view state by ID instead of index. (Унаследовано от 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) |
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) |
RenderingCompatibility |
Возвращает значение, которое задает версию ASP.NET, с которой совместим созданный HTML.Gets a value that specifies the ASP.NET version that rendered HTML will be compatible with. (Унаследовано от Control) |
Site |
Возвращает сведения о контейнере, который содержит текущий элемент управления при визуализации на поверхности конструктора.Gets information about the container that hosts the current control when rendered on a design surface. (Унаследовано от Control) |
SkinID |
Получает или задает обложку для применения к элементу управления HierarchicalDataSourceControl.Gets or sets the skin to apply to the HierarchicalDataSourceControl control. |
TemplateControl |
Возвращает или задает ссылку на шаблон, содержащий этот элемент управления.Gets or sets a reference to the template that contains this control. (Унаследовано от Control) |
TemplateSourceDirectory |
Возвращает виртуальный каталог Page или UserControl, содержащий текущий серверный элемент управления.Gets the virtual directory of the Page or UserControl that contains the current server control. (Унаследовано от Control) |
UniqueID |
Возвращает уникальный идентификатор серверного элемента управления в иерархии.Gets the unique, hierarchically qualified identifier for the server control. (Унаследовано от Control) |
ValidateRequestMode |
Возвращает или задает значение, указывающее, проверяет ли элемент управления полученный из браузера клиентский ввод на предмет потенциально опасных значений.Gets or sets a value that indicates whether the control checks client input from the browser for potentially dangerous values. (Унаследовано от 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 |
Возвращает или задает значение, указывающее, отображается ли элемент управления визуально.Gets or sets a value indicating whether the control is visually displayed. |
Методы
AddedControl(Control, Int32) |
Вызывается после добавления дочернего элемента управления в коллекцию Controls объекта Control.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) |
ApplyStyleSheetSkin(Page) |
Применяет свойства стиля, определенные в таблице стилей страницы, к элементу управления.Applies the style properties that are defined in the page style sheet to the 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 значение |
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 текущего экземпляра элемента управления и любых его дочерних элементов управления значение Inherit.Sets the ClientIDMode property of the current control instance and of any child controls to Inherit. (Унаследовано от Control) |
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. |
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) |
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) |
Выполняет поиск серверного элемента управления с заданным параметром |
FindControl(String, Int32) |
Выполняет поиск в текущем контейнере именования серверного элемента управления с указанным |
Focus() |
Устанавливает фокус ввода на элемент управления.Sets input focus to the control. |
GetDesignModeState() |
Возвращает данные времени разработки для элемента управления.Gets design-time data for a control. (Унаследовано от Control) |
GetHashCode() |
Служит в качестве хэш-функции по умолчанию.Serves as the default hash function. (Унаследовано от Object) |
GetHierarchicalView(String) |
Возвращает объект помощника представления интерфейса IHierarchicalDataSource для указанного пути.Gets the view helper object for the IHierarchicalDataSource interface for the specified path. |
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-адрес, соответствующий набору параметров маршрута и имени маршрута.Gets the URL that corresponds to a set of route parameters and a route name. (Унаследовано от Control) |
GetRouteUrl(String, RouteValueDictionary) |
Возвращает URL-адрес, соответствующий набору параметров маршрута и имени маршрута.Gets the URL that corresponds to a set of route parameters and a route name. (Унаследовано от Control) |
GetType() |
Возвращает объект Type для текущего экземпляра.Gets 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. |
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 page request that was saved by the SaveViewState() method. (Унаследовано от Control) |
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) |
OnBubbleEvent(Object, EventArgs) |
Определяет, передается ли событие серверного элемента управления вверх по иерархии серверных элементов управления пользовательского интерфейса страницы.Determines whether the event for the server control is passed up the page's UI server control hierarchy. (Унаследовано от Control) |
OnDataBinding(EventArgs) |
Вызывает событие DataBinding.Raises the DataBinding event. (Унаследовано от Control) |
OnDataSourceChanged(EventArgs) |
Вызывает событие DataSourceChanged.Raises the DataSourceChanged event. |
OnInit(EventArgs) |
Создает событие Init.Raises the Init event. (Унаследовано от Control) |
OnLoad(EventArgs) |
Создает событие Load.Raises the Load event. (Унаследовано от Control) |
OnPreRender(EventArgs) |
Создает событие PreRender.Raises the PreRender event. (Унаследовано от Control) |
OnUnload(EventArgs) |
Создает событие Unload.Raises the Unload event. (Унаследовано от Control) |
OpenFile(String) |
Возвращает Stream, используемое для чтения файла.Gets 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) |
RemovedControl(Control) |
Вызывается после удаления дочернего элемента управления из коллекции Controls объекта Control.Called after a child control is removed from the Controls collection of the Control object. (Унаследовано от Control) |
Render(HtmlTextWriter) |
Отправляет содержимое серверного элемента управления в предоставленный объект HtmlTextWriter, который записывает содержимое для отрисовки в клиенте.Sends server control content to a provided HtmlTextWriter object, which writes the content to be rendered on the client. (Унаследовано от Control) |
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. |
RenderControl(HtmlTextWriter, ControlAdapter) |
Выводит серверный элемент управления в указанный объект HtmlTextWriter, используя указанный объект ControlAdapter.Outputs server control content to a provided HtmlTextWriter object using a provided ControlAdapter object. (Унаследовано от Control) |
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-адрес в адрес, доступный для клиента.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() |
Сохраняет любые изменения состояния просмотра серверного элемента управления, произошедшие после отправки страницы обратно на сервер.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) |
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() |
Вызывает отслеживание изменений состояния представления серверного элемента управления для сохранения в объекте 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) |
События
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) |
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) |
Явные реализации интерфейса
IControlBuilderAccessor.ControlBuilder |
Описание этого члена см. в разделе ControlBuilder.For 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 |
Описание этого члена см. в разделе UserData.For a description of this member, see UserData. (Унаследовано от Control) |
IDataBindingsAccessor.DataBindings |
Описание этого члена см. в разделе DataBindings.For a description of this member, see DataBindings. (Унаследовано от Control) |
IDataBindingsAccessor.HasDataBindings |
Описание этого члена см. в разделе HasDataBindings.For a description of this member, see HasDataBindings. (Унаследовано от Control) |
IExpressionsAccessor.Expressions |
Описание этого члена см. в разделе Expressions.For a description of this member, see Expressions. (Унаследовано от Control) |
IExpressionsAccessor.HasExpressions |
Описание этого члена см. в разделе HasExpressions.For a description of this member, see HasExpressions. (Унаследовано от Control) |
IHierarchicalDataSource.DataSourceChanged |
Возникает при изменении HierarchicalDataSourceControl таким образом, что это может повлиять на элементы управления, связанные с данными.Occurs when the HierarchicalDataSourceControl has changed in some way that affects data-bound controls. |
IHierarchicalDataSource.GetHierarchicalView(String) |
Возвращает объект помощника представления интерфейса IHierarchicalDataSource для указанного пути.Gets the view helper object for the IHierarchicalDataSource interface for the specified path. |
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. |