DataSourceControl 클래스
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
데이터 바인딩된 컨트롤에 대한 데이터 원본을 나타내는 컨트롤의 기본 클래스 역할을 합니다.
public ref class DataSourceControl abstract : System::Web::UI::Control, System::ComponentModel::IListSource, System::Web::UI::IDataSource
[System.ComponentModel.Bindable(false)]
public abstract class DataSourceControl : System.Web.UI.Control, System.ComponentModel.IListSource, System.Web.UI.IDataSource
[<System.ComponentModel.Bindable(false)>]
type DataSourceControl = class
inherit Control
interface IDataSource
interface IListSource
Public MustInherit Class DataSourceControl
Inherits Control
Implements IDataSource, IListSource
- 상속
- 파생
- 특성
- 구현
예제
다음 코드 예제에서는 클래스가 클래스를 확장할 수 있는 방법을 보여 줍니다 DataSourceControl . 컨트롤은 CsvDataSource .csv 파일에 저장된 쉼표로 구분된 파일 데이터를 나타냅니다. 기본 클래스 구현이 GetView작동하지 않기 때문에 클래스는 CsvDataSource 자체 구현 , GetViewNames및 기타 메서드를 제공합니다.
using System;
using System.Collections;
using System.Data;
using System.IO;
using System.Security.Permissions;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
// The CsvDataSource is a data source control that retrieves its
// data from a comma-separated value file.
[AspNetHostingPermission(SecurityAction.Demand, Level=AspNetHostingPermissionLevel.Minimal)]
public class CsvDataSource : DataSourceControl
{
public CsvDataSource() : base() {}
// The comma-separated value file to retrieve data from.
public string FileName {
get {
return ((CsvDataSourceView)this.GetView(String.Empty)).SourceFile;
}
set {
// Only set if it is different.
if ( ((CsvDataSourceView)this.GetView(String.Empty)).SourceFile != value) {
((CsvDataSourceView)this.GetView(String.Empty)).SourceFile = value;
RaiseDataSourceChangedEvent(EventArgs.Empty);
}
}
}
// Do not add the column names as a data row. Infer columns if the CSV file does
// not include column names.
public bool IncludesColumnNames {
get {
return ((CsvDataSourceView)this.GetView(String.Empty)).IncludesColumnNames;
}
set {
// Only set if it is different.
if ( ((CsvDataSourceView)this.GetView(String.Empty)).IncludesColumnNames != value) {
((CsvDataSourceView)this.GetView(String.Empty)).IncludesColumnNames = value;
RaiseDataSourceChangedEvent(EventArgs.Empty);
}
}
}
// Return a strongly typed view for the current data source control.
private CsvDataSourceView view = null;
protected override DataSourceView GetView(string viewName) {
if (null == view) {
view = new CsvDataSourceView(this, String.Empty);
}
return view;
}
// The ListSourceHelper class calls GetList, which
// calls the DataSourceControl.GetViewNames method.
// Override the original implementation to return
// a collection of one element, the default view name.
protected override ICollection GetViewNames() {
ArrayList al = new ArrayList(1);
al.Add(CsvDataSourceView.DefaultViewName);
return al as ICollection;
}
}
// The CsvDataSourceView class encapsulates the
// capabilities of the CsvDataSource data source control.
public class CsvDataSourceView : DataSourceView
{
public CsvDataSourceView(IDataSource owner, string name) :base(owner, DefaultViewName) {
}
// The data source view is named. However, the CsvDataSource
// only supports one view, so the name is ignored, and the
// default name used instead.
public static string DefaultViewName = "CommaSeparatedView";
// The location of the .csv file.
private string sourceFile = String.Empty;
internal string SourceFile {
get {
return sourceFile;
}
set {
// Use MapPath when the SourceFile is set, so that files local to the
// current directory can be easily used.
string mappedFileName = HttpContext.Current.Server.MapPath(value);
sourceFile = mappedFileName;
}
}
// Do not add the column names as a data row. Infer columns if the CSV file does
// not include column names.
private bool columns = false;
internal bool IncludesColumnNames {
get {
return columns;
}
set {
columns = value;
}
}
// Get data from the underlying data source.
// Build and return a DataView, regardless of mode.
protected override IEnumerable ExecuteSelect(DataSourceSelectArguments selectArgs) {
IEnumerable dataList = null;
// Open the .csv file.
if (File.Exists(this.SourceFile)) {
DataTable data = new DataTable();
// Open the file to read from.
using (StreamReader sr = File.OpenText(this.SourceFile)) {
// Parse the line
string s = "";
string[] dataValues;
DataColumn col;
// Do the following to add schema.
dataValues = sr.ReadLine().Split(',');
// For each token in the comma-delimited string, add a column
// to the DataTable schema.
foreach (string token in dataValues) {
col = new DataColumn(token,typeof(string));
data.Columns.Add(col);
}
// Do not add the first row as data if the CSV file includes column names.
if (!IncludesColumnNames)
data.Rows.Add(CopyRowData(dataValues, data.NewRow()));
// Do the following to add data.
while ((s = sr.ReadLine()) != null) {
dataValues = s.Split(',');
data.Rows.Add(CopyRowData(dataValues, data.NewRow()));
}
}
data.AcceptChanges();
DataView dataView = new DataView(data);
if (!string.IsNullOrEmpty(selectArgs.SortExpression)) {
dataView.Sort = selectArgs.SortExpression;
}
dataList = dataView;
}
else {
throw new System.Configuration.ConfigurationErrorsException("File not found, " + this.SourceFile);
}
if (null == dataList) {
throw new InvalidOperationException("No data loaded from data source.");
}
return dataList;
}
private DataRow CopyRowData(string[] source, DataRow target) {
try {
for (int i = 0;i < source.Length;i++) {
target[i] = source[i];
}
}
catch (System.IndexOutOfRangeException) {
// There are more columns in this row than
// the original schema allows. Stop copying
// and return the DataRow.
return target;
}
return target;
}
// The CsvDataSourceView does not currently
// permit deletion. You can modify or extend
// this sample to do so.
public override bool CanDelete {
get {
return false;
}
}
protected override int ExecuteDelete(IDictionary keys, IDictionary values)
{
throw new NotSupportedException();
}
// The CsvDataSourceView does not currently
// permit insertion of a new record. You can
// modify or extend this sample to do so.
public override bool CanInsert {
get {
return false;
}
}
protected override int ExecuteInsert(IDictionary values)
{
throw new NotSupportedException();
}
// The CsvDataSourceView does not currently
// permit update operations. You can modify or
// extend this sample to do so.
public override bool CanUpdate {
get {
return false;
}
}
protected override int ExecuteUpdate(IDictionary keys, IDictionary values, IDictionary oldValues)
{
throw new NotSupportedException();
}
}
Imports System.Collections
Imports System.Data
Imports System.IO
Imports System.Security.Permissions
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Namespace Samples.AspNet.VB.Controls
' The CsvDataSource is a data source control that retrieves its
' data from a comma-separated value file.
<AspNetHostingPermission(SecurityAction.Demand, Level:=AspNetHostingPermissionLevel.Minimal)> _
Public Class CsvDataSource
Inherits DataSourceControl
Public Sub New()
End Sub
' The comma-separated value file to retrieve data from.
Public Property FileName() As String
Get
Return CType(Me.GetView([String].Empty), CsvDataSourceView).SourceFile
End Get
Set
' Only set if it is different.
If CType(Me.GetView([String].Empty), CsvDataSourceView).SourceFile <> value Then
CType(Me.GetView([String].Empty), CsvDataSourceView).SourceFile = value
RaiseDataSourceChangedEvent(EventArgs.Empty)
End If
End Set
End Property
' Do not add the column names as a data row. Infer columns if the CSV file does
' not include column names.
Public Property IncludesColumnNames() As Boolean
Get
Return CType(Me.GetView([String].Empty), CsvDataSourceView).IncludesColumnNames
End Get
Set
' Only set if it is different.
If CType(Me.GetView([String].Empty), CsvDataSourceView).IncludesColumnNames <> value Then
CType(Me.GetView([String].Empty), CsvDataSourceView).IncludesColumnNames = value
RaiseDataSourceChangedEvent(EventArgs.Empty)
End If
End Set
End Property
' Return a strongly typed view for the current data source control.
Private view As CsvDataSourceView = Nothing
Protected Overrides Function GetView(viewName As String) As DataSourceView
If view Is Nothing Then
view = New CsvDataSourceView(Me, String.Empty)
End If
Return view
End Function 'GetView
' The ListSourceHelper class calls GetList, which
' calls the DataSourceControl.GetViewNames method.
' Override the original implementation to return
' a collection of one element, the default view name.
Protected Overrides Function GetViewNames() As ICollection
Dim al As New ArrayList(1)
al.Add(CsvDataSourceView.DefaultViewName)
Return CType(al, ICollection)
End Function 'GetViewNames
End Class
' The CsvDataSourceView class encapsulates the
' capabilities of the CsvDataSource data source control.
Public Class CsvDataSourceView
Inherits DataSourceView
Public Sub New(owner As IDataSource, name As String)
MyBase.New(owner, DefaultViewName)
End Sub
' The data source view is named. However, the CsvDataSource
' only supports one view, so the name is ignored, and the
' default name used instead.
Public Shared DefaultViewName As String = "CommaSeparatedView"
' The location of the .csv file.
Private aSourceFile As String = [String].Empty
Friend Property SourceFile() As String
Get
Return aSourceFile
End Get
Set
' Use MapPath when the SourceFile is set, so that files local to the
' current directory can be easily used.
Dim mappedFileName As String
mappedFileName = HttpContext.Current.Server.MapPath(value)
aSourceFile = mappedFileName
End Set
End Property
' Do not add the column names as a data row. Infer columns if the CSV file does
' not include column names.
Private columns As Boolean = False
Friend Property IncludesColumnNames() As Boolean
Get
Return columns
End Get
Set
columns = value
End Set
End Property
' Get data from the underlying data source.
' Build and return a DataView, regardless of mode.
Protected Overrides Function ExecuteSelect(selectArgs As DataSourceSelectArguments) _
As System.Collections.IEnumerable
Dim dataList As IEnumerable = Nothing
' Open the .csv file.
If File.Exists(Me.SourceFile) Then
Dim data As New DataTable()
' Open the file to read from.
Dim sr As StreamReader = File.OpenText(Me.SourceFile)
Try
' Parse the line
Dim dataValues() As String
Dim col As DataColumn
' Do the following to add schema.
dataValues = sr.ReadLine().Split(","c)
' For each token in the comma-delimited string, add a column
' to the DataTable schema.
Dim token As String
For Each token In dataValues
col = New DataColumn(token, System.Type.GetType("System.String"))
data.Columns.Add(col)
Next token
' Do not add the first row as data if the CSV file includes column names.
If Not IncludesColumnNames Then
data.Rows.Add(CopyRowData(dataValues, data.NewRow()))
End If
' Do the following to add data.
Dim s As String
Do
s = sr.ReadLine()
If Not s Is Nothing Then
dataValues = s.Split(","c)
data.Rows.Add(CopyRowData(dataValues, data.NewRow()))
End If
Loop Until s Is Nothing
Finally
sr.Close()
End Try
data.AcceptChanges()
Dim dataView As New DataView(data)
If Not selectArgs.SortExpression Is String.Empty Then
dataView.Sort = selectArgs.SortExpression
End If
dataList = dataView
Else
Throw New System.Configuration.ConfigurationErrorsException("File not found, " + Me.SourceFile)
End If
If dataList is Nothing Then
Throw New InvalidOperationException("No data loaded from data source.")
End If
Return dataList
End Function 'ExecuteSelect
Private Function CopyRowData([source]() As String, target As DataRow) As DataRow
Try
Dim i As Integer
For i = 0 To [source].Length - 1
target(i) = [source](i)
Next i
Catch iore As IndexOutOfRangeException
' There are more columns in this row than
' the original schema allows. Stop copying
' and return the DataRow.
Return target
End Try
Return target
End Function 'CopyRowData
' The CsvDataSourceView does not currently
' permit deletion. You can modify or extend
' this sample to do so.
Public Overrides ReadOnly Property CanDelete() As Boolean
Get
Return False
End Get
End Property
Protected Overrides Function ExecuteDelete(keys As IDictionary, values As IDictionary) As Integer
Throw New NotSupportedException()
End Function 'ExecuteDelete
' The CsvDataSourceView does not currently
' permit insertion of a new record. You can
' modify or extend this sample to do so.
Public Overrides ReadOnly Property CanInsert() As Boolean
Get
Return False
End Get
End Property
Protected Overrides Function ExecuteInsert(values As IDictionary) As Integer
Throw New NotSupportedException()
End Function 'ExecuteInsert
' The CsvDataSourceView does not currently
' permit update operations. You can modify or
' extend this sample to do so.
Public Overrides ReadOnly Property CanUpdate() As Boolean
Get
Return False
End Get
End Property
Protected Overrides Function ExecuteUpdate(keys As IDictionary, _
values As IDictionary, _
oldValues As IDictionary) As Integer
Throw New NotSupportedException()
End Function 'ExecuteUpdate
End Class
End Namespace
다음 코드 예제에서는 웹 양식에서 컨트롤을 CsvDataSource 사용 하는 방법을 보여 줍니다.
<%@ Page Language="C#" %>
<%@ Register Tagprefix="aspSample"
Namespace="Samples.AspNet.CS.Controls" %>
<!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:gridview
id="GridView1"
runat="server"
allowsorting="True"
datasourceid="CsvDataSource1" />
<aspSample:CsvDataSource
id = "CsvDataSource1"
runat = "server"
filename = "sample.csv"
includescolumnnames="True" />
</form>
</body>
</html>
<%@ Page Language="VB" %>
<%@ Register Tagprefix="aspSample"
Namespace="Samples.AspNet.VB.Controls" %>
<!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:gridview
id="GridView1"
runat="server"
allowsorting="True"
datasourceid="CsvDataSource1" />
<aspSample:CsvDataSource
id = "CsvDataSource1"
runat = "server"
filename = "sample.csv"
includescolumnnames="True" />
</form>
</body>
</html>
설명
ASP.NET 웹 서버 컨트롤이 일관된 방식으로 데이터에 바인딩할 수 있도록 하는 컨트롤 데이터 바인딩 아키텍처를 지원합니다. 데이터에 바인딩하는 웹 서버 컨트롤을 데이터 바인딩된 컨트롤이라고 하며 해당 바인딩을 용이하게 하는 클래스를 데이터 원본 컨트롤이라고 합니다. 데이터 원본 컨트롤은 관계형 데이터베이스, 파일, 스트림, 비즈니스 개체 등 모든 데이터 원본을 나타낼 수 있습니다. 데이터 원본 컨트롤은 기본 데이터의 원본 또는 형식에 관계없이 데이터 바인딩된 컨트롤에 일관된 방식으로 데이터를 제공합니다.
SqlDataSource, AccessDataSource 및 XmlDataSource 등 ASP.NET 제공되는 데이터 원본 컨트롤을 사용하여 대부분의 웹 개발 작업을 수행합니다. 사용자 고유의 사용자 지정 데이터 원본 제어를 구현하려는 경우 기본 DataSourceControl 클래스를 사용합니다.
IDataSource 인터페이스를 구현하는 모든 클래스는 데이터 원본 제어이지만 대부분의 ASP.NET 데이터 원본 컨트롤은 IDataSource 인터페이스의 기본 구현을 제공하는 추상 DataSourceControl 클래스를 확장합니다. 또한 클래스는 DataSourceControl 프로그래밍 방식으로 데이터 바인딩된 컨트롤의 IListSource 속성에 데이터 소스 컨트롤을 할당 하 고 기본 목록으로 컨트롤에 데이터를 반환 하는 DataSource 인터페이스의 구현을 제공 합니다.
DataBoundControl 클래스에서 파생되는 모든 ASP.NET 컨트롤은 데이터 소스 컨트롤에 바인딩할 수 있습니다.
DataBoundControl 데이터 원본 제어에 바인딩된 경우 데이터 바인딩은 런타임에 자동으로 수행됩니다.
DataSource 또는 DataSourceID 속성을 노출하고 기본 데이터 바인딩을 지원하지만 DataBoundControl 파생되지 않는 ASP.NET 컨트롤과 함께 데이터 원본 컨트롤을 사용할 수도 있습니다. 이러한 데이터 바인딩된 컨트롤을 사용하는 경우 메서드를 DataBind 명시적으로 호출해야 합니다. 데이터 바인딩에 대한 자세한 내용은 ASP.NET 데이터 액세스 콘텐츠 맵을 참조하세요.
데이터 원본 컨트롤을 데이터 원본 뷰라고 하는 개체와 연결된 데이터 목록의 조합 DataSourceControl 으로 생각할 수 있습니다. 각 데이터 목록은 개체로 DataSourceView 표시됩니다. 기본 데이터 스토리지에는 하나 이상의 데이터 DataSourceControl 목록이 포함되어 있으므로 항상 하나 이상의 명명 DataSourceView 된 개체와 연결됩니다. 인터페이스는 IDataSource 모든 데이터 원본 컨트롤이 데이터 원본 뷰 GetViewNames 와 상호 작용하는 데 사용하는 메서드를 정의합니다. 메서드는 현재 데이터 원본 컨트롤과 연결된 데이터 원본 뷰를 열거하는 데 사용되며 GetView , 메서드는 이름으로 특정 데이터 원본 뷰 인스턴스를 검색하는 데 사용됩니다.
또한 데이터 원본 제어를 호출자가 데이터에 액세스하는 데 사용하는 두 가지 고유한 인터페이스로 간주할 수 있습니다. 이 DataSourceControl 클래스는 페이지 개발자가 Web Forms 페이지를 개발할 때 직접 상호 작용하는 인터페이스이며 DataSourceView , 클래스는 데이터 바인딩된 컨트롤과 데이터 바인딩된 컨트롤 작성자가 상호 작용하는 인터페이스입니다. 개체는 DataSourceView 런타임에만 사용할 수 있으므로 데이터 원본 제어 또는 데이터 원본 뷰에 대해 유지되는 모든 상태는 데이터 원본 제어에 의해 직접 노출되어야 합니다.
ASP.NET 데이터 소스 컨트롤의 시각적 렌더링은 없습니다. 이러한 컨트롤은 선언적으로 만들고 필요에 따라 상태 관리에 참여할 수 있도록 컨트롤로 구현됩니다. 따라서 데이터 원본 컨트롤은 시각적 기능(예: EnableTheming 또는 SkinID.)을 지원하지 않습니다.
생성자
| Name | Description |
|---|---|
| DataSourceControl() |
DataSourceControl 클래스의 새 인스턴스를 초기화합니다. |
속성
| Name | Description |
|---|---|
| Adapter |
컨트롤의 브라우저별 어댑터를 가져옵니다. (다음에서 상속됨 Control) |
| AppRelativeTemplateSourceDirectory |
이 컨트롤을 포함하는 개체의 Page 애플리케이션 상대 가상 디렉터리를 가져오거나 UserControl 설정합니다. (다음에서 상속됨 Control) |
| BindingContainer |
이 컨트롤의 데이터 바인딩을 포함하는 컨트롤을 가져옵니다. (다음에서 상속됨 Control) |
| ChildControlsCreated |
서버 컨트롤의 자식 컨트롤이 만들어졌는지 여부를 나타내는 값을 가져옵니다. (다음에서 상속됨 Control) |
| ClientID |
ASP.NET 생성된 서버 컨트롤 식별자를 가져옵니다. |
| ClientIDMode |
이 속성은 데이터 원본 컨트롤에 사용되지 않습니다. |
| ClientIDSeparator |
속성에 사용되는 ClientID 구분 기호 문자를 나타내는 문자 값을 가져옵니다. (다음에서 상속됨 Control) |
| Context |
HttpContext 현재 웹 요청에 대한 서버 컨트롤과 연결된 개체를 가져옵니다. (다음에서 상속됨 Control) |
| Controls |
ControlCollection UI 계층 구조에서 지정된 서버 컨트롤의 자식 컨트롤을 나타내는 개체를 가져옵니다. |
| DataItemContainer |
명명 컨테이너가 구현하는 경우 명명 컨테이너에 대한 참조를 가져옵니다 IDataItemContainer. (다음에서 상속됨 Control) |
| DataKeysContainer |
명명 컨테이너가 구현하는 경우 명명 컨테이너에 대한 참조를 가져옵니다 IDataKeysControl. (다음에서 상속됨 Control) |
| DesignMode |
디자인 화면에서 컨트롤을 사용하고 있는지 여부를 나타내는 값을 가져옵니다. (다음에서 상속됨 Control) |
| EnableTheming |
이 컨트롤이 테마를 지원하는지 여부를 나타내는 값을 가져옵니다. |
| EnableViewState |
서버 컨트롤이 해당 뷰 상태와 해당 뷰에 포함된 자식 컨트롤의 뷰 상태를 요청하는 클라이언트에 유지할지 여부를 나타내는 값을 가져오거나 설정합니다. (다음에서 상속됨 Control) |
| Events |
컨트롤에 대한 이벤트 처리기 대리자 목록을 가져옵니다. 이 속성은 읽기 전용입니다. (다음에서 상속됨 Control) |
| HasChildViewState |
현재 서버 컨트롤의 자식 컨트롤에 저장된 뷰 상태 설정이 있는지 여부를 나타내는 값을 가져옵니다. (다음에서 상속됨 Control) |
| ID |
서버 컨트롤에 할당된 프로그래밍 식별자를 가져오거나 설정합니다. (다음에서 상속됨 Control) |
| IdSeparator |
컨트롤 식별자를 구분하는 데 사용되는 문자를 가져옵니다. (다음에서 상속됨 Control) |
| IsChildControlStateCleared |
이 컨트롤 내에 포함된 컨트롤에 컨트롤 상태가 있는지 여부를 나타내는 값을 가져옵니다. (다음에서 상속됨 Control) |
| IsTrackingViewState |
서버 컨트롤이 뷰 상태에 대한 변경 내용을 저장하고 있는지 여부를 나타내는 값을 가져옵니다. (다음에서 상속됨 Control) |
| IsViewStateEnabled |
이 컨트롤에 대해 뷰 상태를 사용할 수 있는지 여부를 나타내는 값을 가져옵니다. (다음에서 상속됨 Control) |
| LoadViewStateByID |
컨트롤이 인덱스 대신 뷰 상태를 ID 로드하는 데 참여하는지 여부를 나타내는 값을 가져옵니다. (다음에서 상속됨 Control) |
| NamingContainer |
동일한 ID 속성 값을 가진 서버 컨트롤을 구분하기 위한 고유한 네임스페이스를 만드는 서버 컨트롤의 명명 컨테이너에 대한 참조를 가져옵니다. (다음에서 상속됨 Control) |
| Page |
서버 컨트롤이 포함된 인스턴스에 Page 대한 참조를 가져옵니다. (다음에서 상속됨 Control) |
| Parent |
페이지 컨트롤 계층 구조에서 서버 컨트롤의 부모 컨트롤에 대한 참조를 가져옵니다. (다음에서 상속됨 Control) |
| RenderingCompatibility |
렌더링된 HTML과 호환되는 ASP.NET 버전을 지정하는 값을 가져옵니다. (다음에서 상속됨 Control) |
| Site |
디자인 화면에서 렌더링될 때 현재 컨트롤을 호스트하는 컨테이너에 대한 정보를 가져옵니다. (다음에서 상속됨 Control) |
| SkinID |
컨트롤에 적용할 스킨을 DataSourceControl 가져옵니다. |
| TemplateControl |
이 컨트롤을 포함하는 템플릿에 대한 참조를 가져오거나 설정합니다. (다음에서 상속됨 Control) |
| TemplateSourceDirectory |
현재 서버 컨트롤을 Page 포함하는 가상 디렉터리를 가져옵니다 UserControl . (다음에서 상속됨 Control) |
| UniqueID |
서버 컨트롤에 대해 계층적으로 정규화된 고유 식별자를 가져옵니다. (다음에서 상속됨 Control) |
| ValidateRequestMode |
컨트롤이 잠재적으로 위험한 값에 대해 브라우저에서 클라이언트 입력을 확인하는지 여부를 나타내는 값을 가져오거나 설정합니다. (다음에서 상속됨 Control) |
| ViewState |
동일한 페이지에 대한 여러 요청에서 서버 컨트롤의 뷰 상태를 저장하고 복원할 수 있는 상태 정보 사전을 가져옵니다. (다음에서 상속됨 Control) |
| ViewStateIgnoresCase |
개체가 대/소문자를 구분하지 않는지 여부를 StateBag 나타내는 값을 가져옵니다. (다음에서 상속됨 Control) |
| ViewStateMode |
이 컨트롤의 뷰 상태 모드를 가져오거나 설정합니다. (다음에서 상속됨 Control) |
| Visible |
컨트롤이 시각적으로 표시되는지 여부를 나타내는 값을 가져오거나 설정합니다. |
메서드
| Name | Description |
|---|---|
| AddedControl(Control, Int32) |
자식 컨트롤이 개체 컬렉션 Controls 에 추가된 Control 후 호출됩니다. (다음에서 상속됨 Control) |
| AddParsedSubObject(Object) |
XML 또는 HTML 요소가 구문 분석되었음을 서버 컨트롤에 알리고 해당 요소를 서버 컨트롤의 ControlCollection 개체에 추가합니다. (다음에서 상속됨 Control) |
| ApplyStyleSheetSkin(Page) |
페이지 스타일시트에 정의된 스타일 속성을 컨트롤에 적용합니다. |
| BeginRenderTracing(TextWriter, Object) |
렌더링 데이터의 디자인 타임 추적을 시작합니다. (다음에서 상속됨 Control) |
| BuildProfileTree(String, Boolean) |
서버 컨트롤에 대한 정보를 수집하여 Trace 페이지에 대해 추적을 사용하도록 설정할 때 표시할 속성에 전달합니다. (다음에서 상속됨 Control) |
| ClearCachedClientID() |
캐시된 ClientID 값을 .로 |
| ClearChildControlState() |
서버 컨트롤의 자식 컨트롤에 대한 컨트롤 상태 정보를 삭제합니다. (다음에서 상속됨 Control) |
| ClearChildState() |
모든 서버 컨트롤의 자식 컨트롤에 대한 뷰 상태 및 컨트롤 상태 정보를 삭제합니다. (다음에서 상속됨 Control) |
| ClearChildViewState() |
모든 서버 컨트롤의 자식 컨트롤에 대한 뷰 상태 정보를 삭제합니다. (다음에서 상속됨 Control) |
| ClearEffectiveClientIDMode() |
ClientIDMode 현재 컨트롤 인스턴스 및 자식 Inherit컨트롤의 속성을 .로 설정합니다. (다음에서 상속됨 Control) |
| CreateChildControls() |
컴퍼지션 기반 구현을 사용하는 서버 컨트롤에 알리기 위해 ASP.NET 페이지 프레임워크에서 호출하여 다시 게시 또는 렌더링 준비에 포함된 자식 컨트롤을 만듭니다. (다음에서 상속됨 Control) |
| CreateControlCollection() |
자식 컨트롤을 저장할 컬렉션을 만듭니다. |
| DataBind() |
호출된 서버 컨트롤 및 모든 자식 컨트롤에 데이터 원본을 바인딩합니다. (다음에서 상속됨 Control) |
| DataBind(Boolean) |
이벤트를 발생시키는 옵션을 사용하여 호출된 서버 컨트롤 및 모든 자식 컨트롤에 데이터 원본을 DataBinding 바인딩합니다. (다음에서 상속됨 Control) |
| DataBindChildren() |
데이터 원본을 서버 컨트롤의 자식 컨트롤에 바인딩합니다. (다음에서 상속됨 Control) |
| Dispose() |
서버 컨트롤이 메모리에서 해제되기 전에 최종 정리를 수행할 수 있도록 합니다. (다음에서 상속됨 Control) |
| EndRenderTracing(TextWriter, Object) |
렌더링 데이터의 디자인 타임 추적을 종료합니다. (다음에서 상속됨 Control) |
| EnsureChildControls() |
서버 컨트롤에 자식 컨트롤이 포함되어 있는지 여부를 확인합니다. 그렇지 않으면 자식 컨트롤을 만듭니다. (다음에서 상속됨 Control) |
| EnsureID() |
할당된 식별자가 없는 컨트롤에 대한 식별자를 만듭니다. (다음에서 상속됨 Control) |
| Equals(Object) |
지정한 개체와 현재 개체가 같은지 여부를 확인합니다. (다음에서 상속됨 Object) |
| FindControl(String, Int32) |
현재 명명 컨테이너에서 지정된 |
| FindControl(String) |
지정된 매개 변수를 사용하여 현재 명명 컨테이너에서 서버 컨트롤을 검색합니다 |
| Focus() |
입력 포커스를 컨트롤로 설정합니다. |
| 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) |
| GetView(String) |
데이터 원본 컨트롤과 연결된 명명된 데이터 원본 뷰를 가져옵니다. |
| GetViewNames() |
컨트롤과 연결된 DataSourceView 개체 목록을 나타내는 DataSourceControl 이름 컬렉션을 가져옵니다. |
| HasControls() |
서버 컨트롤에 자식 컨트롤이 포함되어 있는지 여부를 확인합니다. |
| HasEvents() |
이벤트가 컨트롤에 대해 등록되었는지 또는 자식 컨트롤에 대해 등록되었는지 여부를 나타내는 값을 반환합니다. (다음에서 상속됨 Control) |
| IsLiteralContent() |
서버 컨트롤에 리터럴 콘텐츠만 있는지 여부를 확인합니다. (다음에서 상속됨 Control) |
| LoadControlState(Object) |
메서드에서 저장한 이전 페이지 요청에서 컨트롤 상태 정보를 복원합니다 SaveControlState() . (다음에서 상속됨 Control) |
| LoadViewState(Object) |
메서드에서 저장한 이전 페이지 요청에서 뷰 상태 정보를 복원합니다 SaveViewState() . (다음에서 상속됨 Control) |
| MapPathSecure(String) |
가상 경로(절대 경로 또는 상대 경로)가 매핑되는 실제 경로를 검색합니다. (다음에서 상속됨 Control) |
| MemberwiseClone() |
현재 Object단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
| 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) |
| RaiseDataSourceChangedEvent(EventArgs) |
DataSourceChanged 이벤트를 발생시킵니다. |
| RemovedControl(Control) |
자식 컨트롤이 개체 컬렉션 Controls 에서 Control 제거된 후 호출됩니다. (다음에서 상속됨 Control) |
| Render(HtmlTextWriter) |
제공된 HtmlTextWriter 개체에 서버 컨트롤 콘텐츠를 전송합니다. 이 개체는 클라이언트에서 렌더링할 콘텐츠를 씁니다. (다음에서 상속됨 Control) |
| RenderChildren(HtmlTextWriter) |
서버 컨트롤의 자식 콘텐츠를 제공된 HtmlTextWriter 개체에 출력하여 클라이언트에서 렌더링할 콘텐츠를 씁니다. (다음에서 상속됨 Control) |
| RenderControl(HtmlTextWriter, ControlAdapter) |
제공 HtmlTextWriter 된 개체를 사용하여 제공된 ControlAdapter 개체에 서버 컨트롤 콘텐츠를 출력합니다. (다음에서 상속됨 Control) |
| RenderControl(HtmlTextWriter) |
서버 컨트롤 콘텐츠를 제공된 HtmlTextWriter 개체에 출력하고 추적을 사용하는 경우 컨트롤에 대한 추적 정보를 저장합니다. |
| ResolveAdapter() |
지정된 컨트롤을 렌더링하는 컨트롤 어댑터를 가져옵니다. (다음에서 상속됨 Control) |
| ResolveClientUrl(String) |
브라우저에서 사용할 수 있는 URL을 가져옵니다. (다음에서 상속됨 Control) |
| ResolveUrl(String) |
URL을 요청 클라이언트에서 사용할 수 있는 URL로 변환합니다. (다음에서 상속됨 Control) |
| SaveControlState() |
페이지가 서버에 다시 게시된 이후 발생한 모든 서버 제어 상태 변경 내용을 저장합니다. (다음에서 상속됨 Control) |
| SaveViewState() |
페이지가 서버에 다시 게시된 이후 발생한 서버 컨트롤 뷰 상태 변경 내용을 저장합니다. (다음에서 상속됨 Control) |
| SetDesignModeState(IDictionary) |
컨트롤의 디자인 타임 데이터를 설정합니다. (다음에서 상속됨 Control) |
| SetRenderMethodDelegate(RenderMethod) |
이벤트 처리기 대리자를 할당하여 서버 컨트롤과 해당 콘텐츠를 부모 컨트롤에 렌더링합니다. (다음에서 상속됨 Control) |
| SetTraceData(Object, Object, Object) |
추적된 개체, 추적 데이터 키 및 추적 데이터 값을 사용하여 렌더링 데이터의 디자인 타임 추적을 위한 추적 데이터를 설정합니다. (다음에서 상속됨 Control) |
| SetTraceData(Object, Object) |
추적 데이터 키 및 추적 데이터 값을 사용하여 렌더링 데이터의 디자인 타임 추적을 위한 추적 데이터를 설정합니다. (다음에서 상속됨 Control) |
| ToString() |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |
| TrackViewState() |
서버 컨트롤의 개체에 저장할 StateBag 수 있도록 서버 컨트롤의 뷰 상태 변경 내용을 추적합니다. 이 개체는 속성을 통해 액세스할 수 있습니다 ViewState . (다음에서 상속됨 Control) |
이벤트
| Name | Description |
|---|---|
| DataBinding |
서버 컨트롤이 데이터 원본에 바인딩할 때 발생합니다. (다음에서 상속됨 Control) |
| Disposed |
ASP.NET 페이지가 요청될 때 서버 컨트롤 수명 주기의 마지막 단계인 메모리에서 서버 컨트롤이 해제될 때 발생합니다. (다음에서 상속됨 Control) |
| Init |
서버 컨트롤이 초기화될 때 발생하며 이는 수명 주기의 첫 번째 단계입니다. (다음에서 상속됨 Control) |
| Load |
서버 컨트롤이 개체에 Page 로드될 때 발생합니다. (다음에서 상속됨 Control) |
| PreRender |
개체를 Control 로드한 후 렌더링하기 전에 발생합니다. (다음에서 상속됨 Control) |
| Unload |
서버 컨트롤이 메모리에서 언로드될 때 발생합니다. (다음에서 상속됨 Control) |
명시적 인터페이스 구현
확장명 메서드
| Name | Description |
|---|---|
| FindDataSourceControl(Control) |
지정된 컨트롤의 데이터 컨트롤과 연결된 데이터 원본을 반환합니다. |
| FindFieldTemplate(Control, String) |
지정된 컨트롤의 명명 컨테이너에서 지정된 열에 대한 필드 템플릿을 반환합니다. |
| FindMetaTable(Control) |
포함하는 데이터 컨트롤에 대한 충족 가능한 개체를 반환합니다. |
| GetDefaultValues(IDataSource) |
지정된 데이터 원본에 대한 기본값의 컬렉션을 가져옵니다. |
| GetMetaTable(IDataSource) |
지정된 데이터 원본 개체의 테이블에 대한 메타데이터를 가져옵니다. |
| TryGetMetaTable(IDataSource, MetaTable) |
테이블 메타데이터를 사용할 수 있는지 여부를 결정합니다. |