DataSourceControl 클래스

정의

데이터 바인딩된 컨트롤에 대한 데이터 소스를 나타내는 컨트롤의 기본 클래스로 사용됩니다.

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
파생
특성
구현

예제

다음 코드 예제에서는 클래스 수 확장 하는 방법을 보여 줍니다는 DataSourceControl 클래스입니다. CsvDataSource 컨트롤.csv 파일에 저장 하는 쉼표로 구분 된 파일 데이터를 나타냅니다. CsvDataSource 클래스의 자체 구현을 제공 합니다 GetView, 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 웹 서버 컨트롤에 일관 된 방식으로 데이터를 바인딩할 수 있게 해 주는 컨트롤 데이터 바인딩 아키텍처를 지원 합니다. 데이터에 바인딩되는 웹 서버 컨트롤은 데이터 바인딩된 컨트롤과 바인딩 데이터 소스 컨트롤 이라고 하는 클래스 라고 합니다. 데이터 소스 컨트롤에서 모든 데이터 소스를 나타낼 수 있습니다: 관계형 데이터베이스, 파일, 스트림, 비즈니스 개체 및 등입니다. 데이터 소스 컨트롤에서 소스 나 기본 데이터의 형식에 관계 없이 데이터 바인딩된 컨트롤에 일관 된 방식으로 데이터를 제공 합니다.

제공 되는 데이터 소스 컨트롤을 사용 하 여 asp.net을 포함 하 여 SqlDataSource, AccessDataSource, 및 XmlDataSource, 대부분의 웹 개발 작업을 수행 하 합니다. 기본 사용 DataSourceControl 사용자 고유의 사용자 지정 데이터 소스 제어를 구현 하려는 경우 클래스입니다.

구현 하는 모든 클래스는 IDataSource 인터페이스는 데이터 소스 컨트롤, 대부분의 ASP.NET 데이터 소스 컨트롤 확장 추상 DataSourceControl 의 기본 구현을 제공 하는 클래스는 IDataSource 인터페이스입니다. DataSourceControl 클래스의 구현을 제공 합니다 IListSource 데이터 소스 컨트롤을 프로그래밍 방식으로 할당할 수 있는 인터페이스를를 DataSource 반환 데이터를 기본 목록으로 컨트롤을 데이터 바인딩된 컨트롤의 속성입니다.

파생 되는 모든 ASP.NET 컨트롤을 DataBoundControl 클래스는 데이터 소스 컨트롤에 바인딩할 수 있습니다. 경우는 DataBoundControl 바인딩된 데이터 소스 컨트롤에 데이터 바인딩이 자동으로 수행 됩니다 런타임 시. 노출 하는 ASP.NET 컨트롤을 사용 하 여 데이터 소스 컨트롤을 사용할 수도 있습니다는 DataSourceDataSourceID 속성 및 기본 데이터 바인딩을 지원 되지만에서 파생 되지 않은 DataBoundControl합니다. 명시적으로 호출 해야 이러한 데이터 바인딩된 컨트롤을 사용 하는 경우는 DataBind 메서드. 데이터 바인딩에 대 한 자세한 내용은 참조 하세요. ASP.NET 데이터 액세스 콘텐츠 맵합니다.

데이터 소스 컨트롤의 조합으로 생각할 수 있습니다는 DataSourceControl 개체 목록과 해당 관련 데이터를 데이터 원본 뷰를 호출 합니다. 각 데이터 목록이 표시 됩니다는 DataSourceView 개체입니다. 기본 데이터 스토리지에는 하나 이상의 데이터 목록이 포함되어 있으므로 DataSourceControl은 항상 하나 이상의 명명된 DataSourceView 개체와 연결됩니다. IDataSource 데이터 원본 뷰를 사용 하 여 상호 작용 하도록 모든 데이터 소스 컨트롤을 사용 하는 메서드를 정의 하는 인터페이스: 합니다 GetViewNames 메서드는 열거 하는 데 현재 데이터 소스 컨트롤과 연결 된 데이터 원본 뷰 및 GetView 메서드 이름으로 특정 데이터 원본 보기 인스턴스를 검색에 사용 됩니다.

데이터에 액세스 하려면 호출자가 사용 하는 별개의 두 인터페이스 처럼 데이터 소스 컨트롤의 생각할 수 있습니다. 합니다 DataSourceControl 클래스는 페이지 개발자는 Web Forms 페이지를 개발 하는 경우 직접 상호 작용 하는 인터페이스 및 DataSourceView 클래스는 데이터 바인딩된 컨트롤 및 데이터 바인딩된 컨트롤 작성자가 상호 작용 하는 인터페이스입니다. 때문에 DataSourceView 런타임에만 개체를 사용할 수, 데이터 소스 컨트롤에 대 한 모든 상태 유지 또는 데이터 원본 뷰는 데이터 소스 컨트롤에서 직접 노출 되어야 합니다.

시각적으로 ASP.NET 데이터 소스 컨트롤에 렌더링 되지 필요에 따라 상태 관리에 참여할 수 있도록를 선언적으로 만들 수 있도록 컨트롤로 구현 됩니다. 결과적으로, 데이터 소스 제어와 지원 하지 않는 시각적 기능 같은 EnableTheming 또는 SkinID합니다.

생성자

DataSourceControl()

DataSourceControl 클래스의 새 인스턴스를 초기화합니다.

속성

Adapter

컨트롤에 대한 브라우저별 어댑터를 가져옵니다.

(다음에서 상속됨 Control)
AppRelativeTemplateSourceDirectory

이 컨트롤이 포함된 Page 또는 UserControl 개체의 애플리케이션 상대 가상 디렉터리를 가져오거나 설정합니다.

(다음에서 상속됨 Control)
BindingContainer

이 컨트롤의 데이터 바인딩이 포함된 컨트롤을 가져옵니다.

(다음에서 상속됨 Control)
ChildControlsCreated

서버 컨트롤의 자식 컨트롤이 만들어졌는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Control)
ClientID

ASP.NET에서 생성한 서버 컨트롤 식별자를 가져옵니다.

ClientIDMode

이 속성은 데이터 소스 컨트롤에 사용되지 않습니다.

ClientIDMode

ClientID 속성의 값을 생성하는 데 사용되는 알고리즘을 가져오거나 설정합니다.

(다음에서 상속됨 Control)
ClientIDSeparator

ClientID 속성에 사용된 구분 문자를 나타내는 문자 값을 가져옵니다.

(다음에서 상속됨 Control)
Context

현재 웹 요청에 대한 서버 컨트롤과 관련된 HttpContext 개체를 가져옵니다.

(다음에서 상속됨 Control)
Controls

UI 계층 구조에서 지정된 서버 컨트롤의 자식 컨트롤을 나타내는 ControlCollection 개체를 가져옵니다.

DataItemContainer

명명 컨테이너가 IDataItemContainer를 구현할 경우 명명 컨테이너에 대한 참조를 가져옵니다.

(다음에서 상속됨 Control)
DataKeysContainer

명명 컨테이너가 IDataKeysControl를 구현할 경우 명명 컨테이너에 대한 참조를 가져옵니다.

(다음에서 상속됨 Control)
DesignMode

디자인 화면에서 컨트롤이 사용 중인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Control)
EnableTheming

이 컨트롤이 테마를 지원하는지 여부를 나타내는 값을 가져옵니다.

EnableViewState

서버 컨트롤이 해당 뷰 상태와 포함하고 있는 모든 자식 컨트롤의 뷰 상태를, 요청하는 클라이언트까지 유지하는지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 Control)
Events

컨트롤에 대한 이벤트 처리기 대리자의 목록을 가져옵니다. 이 속성은 읽기 전용입니다.

(다음에서 상속됨 Control)
HasChildViewState

현재 서버 컨트롤의 자식 컨트롤에 저장된 뷰 상태 설정 값이 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Control)
ID

서버 컨트롤에 할당된 프로그래밍 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

컨트롤이 표시되는지 여부를 나타내는 값을 가져오거나 설정합니다.

메서드

AddedControl(Control, Int32)

자식 컨트롤이 Control 개체의 Controls 컬렉션에 추가된 후 호출됩니다.

(다음에서 상속됨 Control)
AddParsedSubObject(Object)

XML 또는 HTML 요소가 구문 분석되었음을 서버 컨트롤에 알리고 서버 컨트롤의 ControlCollection 개체에 요소를 추가합니다.

(다음에서 상속됨 Control)
ApplyStyleSheetSkin(Page)

페이지 스타일시트에 정의된 스타일 속성을 컨트롤에 적용합니다.

BeginRenderTracing(TextWriter, Object)

렌더링 데이터의 디자인 타임 추적을 시작합니다.

(다음에서 상속됨 Control)
BuildProfileTree(String, Boolean)

서버 컨트롤에 대한 정보를 수집하고, 페이지에 대해 추적이 활성화된 경우 표시할 Trace 속성에 이 정보를 전달합니다.

(다음에서 상속됨 Control)
ClearCachedClientID()

캐시된 ClientID 값을 null로 설정합니다.

(다음에서 상속됨 Control)
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()

ID가 할당되지 않은 컨트롤의 ID를 만듭니다.

(다음에서 상속됨 Control)
Equals(Object)

지정된 개체가 현재 개체와 같은지 확인합니다.

(다음에서 상속됨 Object)
FindControl(String)

지정된 id 매개 변수를 사용하여 서버 컨트롤의 현재 명명 컨테이너를 검색합니다.

FindControl(String, Int32)

현재 명명 컨테이너에서 특정 id와 함께 pathOffset 매개 변수에 지정된 검색용 정수를 사용하여 서버 컨트롤을 검색합니다. 이 버전의 FindControl 메서드를 재정의해서는 안됩니다.

(다음에서 상속됨 Control)
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)

자식 컨트롤이 Control 개체의 Controls 컬렉션에서 제거된 후 호출됩니다.

(다음에서 상속됨 Control)
Render(HtmlTextWriter)

클라이언트에서 렌더링할 콘텐츠를 쓰는 지정된 HtmlTextWriter 개체에 서버 컨트롤 콘텐츠를 보냅니다.

(다음에서 상속됨 Control)
RenderChildren(HtmlTextWriter)

클라이언트에서 렌더링될 내용을 쓰는 제공된 HtmlTextWriter 개체에 서버 컨트롤 자식의 내용을 출력합니다.

(다음에서 상속됨 Control)
RenderControl(HtmlTextWriter)

제공된 HtmlTextWriter 개체로 서버 컨트롤 콘텐츠를 출력하고 추적을 사용하는 경우 컨트롤에 대한 추적 정보를 저장합니다.

RenderControl(HtmlTextWriter, ControlAdapter)

제공된 HtmlTextWriter 개체를 사용하여 제공된 ControlAdapter 개체에 서버 컨트롤 콘텐츠를 출력합니다.

(다음에서 상속됨 Control)
ResolveAdapter()

지정된 컨트롤을 렌더링하는 컨트롤 어댑터를 가져옵니다.

(다음에서 상속됨 Control)
ResolveClientUrl(String)

브라우저에 사용할 수 있는 URL을 가져옵니다.

(다음에서 상속됨 Control)
ResolveUrl(String)

URL을 요청 클라이언트에서 사용할 수 있는 URL로 변환합니다.

(다음에서 상속됨 Control)
SaveControlState()

페이지가 서버에 다시 게시된 후 발생한 서버 컨트롤 상태의 변경을 저장합니다.

(다음에서 상속됨 Control)
SaveViewState()

페이지가 서버에 다시 게시된 이후 발생한 서버 컨트롤 뷰 상태의 변경을 저장합니다.

(다음에서 상속됨 Control)
SetDesignModeState(IDictionary)

컨트롤에 대한 디자인 타임 데이터를 설정합니다.

(다음에서 상속됨 Control)
SetRenderMethodDelegate(RenderMethod)

이벤트 처리기 대리자를 할당하여 서버 컨트롤과 그 콘텐츠를 부모 컨트롤로 렌더링합니다.

(다음에서 상속됨 Control)
SetTraceData(Object, Object)

추적 데이터 키와 추적 데이터 값을 사용하여 렌더링 데이터의 디자인 타임 추적을 위한 추적 데이터를 설정합니다.

(다음에서 상속됨 Control)
SetTraceData(Object, Object, Object)

추적 개체, 추적 데이터 키와 추적 데이터 값을 사용하여 렌더링 데이터의 디자인 타임 추적을 위한 추적 데이터를 설정합니다.

(다음에서 상속됨 Control)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)
TrackViewState()

서버 컨트롤의 뷰 상태 변경 사항 추적 작업을 실행하여 서버 컨트롤의 StateBag 개체에 변경 사항이 저장되도록 합니다. 이 개체는 ViewState 속성을 통해 액세스할 수 있습니다.

(다음에서 상속됨 Control)

이벤트

DataBinding

서버 컨트롤에서 데이터 소스에 바인딩할 때 발생합니다.

(다음에서 상속됨 Control)
Disposed

ASP.NET 페이지가 요청될 때 서버 컨트롤 주기의 마지막 단계로 서버 컨트롤이 메모리에서 해제될 때 발생합니다.

(다음에서 상속됨 Control)
Init

서버 컨트롤 주기의 첫 단계로 서버 컨트롤을 초기화할 때 이 이벤트가 발생합니다.

(다음에서 상속됨 Control)
Load

Page 개체에 서버 컨트롤을 로드할 때 발생합니다.

(다음에서 상속됨 Control)
PreRender

Control 개체가 로드된 후, 렌더링 전에 발생합니다.

(다음에서 상속됨 Control)
Unload

서버 컨트롤이 메모리에서 언로드될 때 발생합니다.

(다음에서 상속됨 Control)

명시적 인터페이스 구현

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)
IDataSource.DataSourceChanged

이 이벤트는 데이터 바인딩된 컨트롤에 영향을 주는 방식으로 데이터 소스 컨트롤이 변경된 경우에 발생합니다.

IDataSource.GetView(String)

DataSourceView 컨트롤과 연결된 명명된 DataSourceControl 개체를 가져옵니다. 일부 데이터 소스 컨트롤은 하나의 뷰만 지원하지만 다른 컨트롤은 둘 이상의 뷰를 지원합니다.

IDataSource.GetViewNames()

DataSourceView 컨트롤과 연결된 DataSourceControl 개체의 목록을 나타내는 이름 컬렉션을 가져옵니다.

IExpressionsAccessor.Expressions

이 멤버에 대한 설명은 Expressions를 참조하세요.

(다음에서 상속됨 Control)
IExpressionsAccessor.HasExpressions

이 멤버에 대한 설명은 HasExpressions를 참조하세요.

(다음에서 상속됨 Control)
IListSource.ContainsListCollection

데이터 소스 컨트롤이 하나 이상의 데이터 목록과 연결되어 있는지 여부를 나타냅니다.

IListSource.GetList()

데이터 목록의 소스로 사용할 수 있는 데이터 소스 컨트롤 목록을 가져옵니다.

IParserAccessor.AddParsedSubObject(Object)

이 멤버에 대한 설명은 AddParsedSubObject(Object)를 참조하세요.

(다음에서 상속됨 Control)

확장 메서드

FindDataSourceControl(Control)

지정된 컨트롤에 대한 데이터 컨트롤에 연결된 데이터 소스를 반환합니다.

FindFieldTemplate(Control, String)

지정된 컨트롤의 명명 컨테이너에서 지정된 열에 대한 필드 템플릿을 반환합니다.

FindMetaTable(Control)

상위 데이터 컨트롤에 대한 메타테이블 개체를 반환합니다.

GetDefaultValues(IDataSource)

지정된 데이터 소스의 기본값에 대한 컬렉션을 가져옵니다.

GetMetaTable(IDataSource)

지정된 데이터 소스 개체의 테이블에 대한 메타데이터를 가져옵니다.

TryGetMetaTable(IDataSource, MetaTable)

테이블 메타데이터를 사용할 수 있는지 여부를 결정합니다.

적용 대상

추가 정보