ObjectDataSource 클래스

정의

다중 계층 웹 애플리케이션 아키텍처의 데이터 바인딩된 컨트롤에 데이터를 제공하는 비즈니스 개체를 나타냅니다.

public ref class ObjectDataSource : System::Web::UI::DataSourceControl
[System.Drawing.ToolboxBitmap(typeof(System.Web.UI.WebControls.ObjectDataSource))]
public class ObjectDataSource : System.Web.UI.DataSourceControl
[<System.Drawing.ToolboxBitmap(typeof(System.Web.UI.WebControls.ObjectDataSource))>]
type ObjectDataSource = class
    inherit DataSourceControl
Public Class ObjectDataSource
Inherits DataSourceControl
상속
ObjectDataSource
특성

예제

이 섹션에서는 ObjectDataSource 태그는.aspx에서 페이지 표시에서 작동 하는 비즈니스 개체입니다. 이 예제에서는.aspx 페이지입니다. 포함을 GridView 바인딩되는 컨트롤을 ObjectDataSource 컨트롤입니다. ObjectDataSource 컨트롤 태그 지정 비즈니스 개체의 이름 및 데이터를 검색 하기 위해 호출할 비즈니스 개체 메서드의 이름입니다.

<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.CS" Assembly="Samples.AspNet.CS" %>
<%@ Page language="c#" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head>
    <title>ObjectDataSource - C# Example</title>
  </head>
  <body>
    <form id="Form1" method="post" runat="server">

        <asp:gridview
          id="GridView1"
          runat="server"
          datasourceid="ObjectDataSource1" />

        <asp:objectdatasource
          id="ObjectDataSource1"
          runat="server"
          selectmethod="GetAllEmployees"
          typename="Samples.AspNet.CS.EmployeeLogic" />

    </form>
  </body>
</html>
<%@ Register TagPrefix="aspSample" Namespace="Samples.AspNet.VB" Assembly="Samples.AspNet.VB" %>
<%@ Page language="vb" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
  <head>
    <title>ObjectDataSource - Visual Basic Example</title>
  </head>
  <body>
    <form id="Form1" method="post" runat="server">

        <asp:gridview
          id="GridView1"
          runat="server"
          datasourceid="ObjectDataSource1" />

        <asp:objectdatasource
          id="ObjectDataSource1"
          runat="server"
          selectmethod="GetAllEmployees"
          typename="Samples.AspNet.VB.EmployeeLogic" />

    </form>
  </body>
</html>

다음 예에서는 비즈니스 개체는 ObjectDataSource .aspx 페이지에서 컨트롤을 사용 합니다. (다른 많은 ObjectDataSource 코드 예제도이 비즈니스 개체를 사용 합니다.) 이 예제에서는 다음 두 개의 기본 클래스로 이루어져 있습니다.

  • 합니다 EmployeeLogic 클래스는 비즈니스 논리 클래스는 ObjectDataSource 사용 합니다.

  • NorthwindEmployee 클래스에서 반환 되는 데이터 개체를 정의 합니다 GetAllEmployees 메서드를 EmployeeLogic 클래스.

추가 NorthwindDataException 클래스는 편의 위해 제공 됩니다.

이 예제에서는 클래스이 집합을 Microsoft SQL Server 및 Microsoft Access를 사용 하 여 사용할 수 있는 여 Northwind 데이터베이스를 사용 하 여 작동 합니다. 전체 작업 예제를 컴파일 및 제공 되는.aspx 페이지 예제를 사용 하 여 이러한 클래스를 사용 해야 합니다.

namespace Samples.AspNet.CS {

using System;
using System.Collections;
using System.Collections.Specialized;
using System.Configuration;
using System.Data;
using System.Data.SqlClient;
using System.Web.UI;
using System.Web.UI.WebControls;
  //
  // EmployeeLogic is a stateless business object that encapsulates
  // the operations one can perform on a NorthwindEmployee object.
  //
  public class EmployeeLogic {

    // Returns a collection of NorthwindEmployee objects.
    public static ICollection GetAllEmployees () {
      ArrayList al = new ArrayList();

      ConnectionStringSettings cts = ConfigurationManager.ConnectionStrings["NorthwindConnection"];

      SqlDataSource sds
        = new SqlDataSource(cts.ConnectionString, "SELECT EmployeeID FROM Employees");

      try {

        IEnumerable IDs = sds.Select(DataSourceSelectArguments.Empty);

        // Iterate through the Enumeration and create a
        // NorthwindEmployee object for each ID.
        foreach (DataRowView row in IDs) {
          string id = row["EmployeeID"].ToString();
          NorthwindEmployee nwe = new NorthwindEmployee(id);
          // Add the NorthwindEmployee object to the collection.
          al.Add(nwe);
        }
      }
      finally {
        // If anything strange happens, clean up.
        sds.Dispose();
      }

      return al;
    }
    public static NorthwindEmployee GetEmployee(object anID) {
      return new NorthwindEmployee(anID);
    }

    public static void UpdateEmployeeInfo(NorthwindEmployee ne) {
      bool retval = ne.Save();
      if (! retval) { throw new NorthwindDataException("UpdateEmployee failed."); }
    }

    public static void DeleteEmployee(NorthwindEmployee ne) { }
  }

  public class NorthwindEmployee {

    public NorthwindEmployee () {
      ID = DBNull.Value;
      lastName = "";
      firstName = "";
      title="";
      titleOfCourtesy = "";
      reportsTo = -1;
    }

    public NorthwindEmployee (object anID) {
      this.ID = anID;

      ConnectionStringSettings cts = ConfigurationManager.ConnectionStrings["NorthwindConnection"];

        SqlConnection conn = new SqlConnection (cts.ConnectionString);
      SqlCommand sc =
        new SqlCommand(" SELECT FirstName,LastName,Title,TitleOfCourtesy,ReportsTo " +
                       " FROM Employees " +
                       " WHERE EmployeeID = @empId",
                       conn);
      // Add the employee ID parameter and set its value.
      sc.Parameters.Add(new SqlParameter("@empId",SqlDbType.Int)).Value = Int32.Parse(anID.ToString());
      SqlDataReader sdr = null;

      try {
        conn.Open();
        sdr = sc.ExecuteReader();

        // This is not a while loop. It only loops once.
        if (sdr != null && sdr.Read()) {
          // The IEnumerable contains DataRowView objects.
          this.firstName        = sdr["FirstName"].ToString();
          this.lastName         = sdr["LastName"].ToString();
          this.title            = sdr["Title"].ToString();
          this.titleOfCourtesy  = sdr["TitleOfCourtesy"].ToString();
          if (! sdr.IsDBNull(4)) {
            this.reportsTo        = sdr.GetInt32(4);
          }
        }
        else {
          throw new NorthwindDataException("Data not loaded for employee id.");
        }
      }
      finally {
        try {
          if (sdr != null) sdr.Close();
          conn.Close();
        }
        catch (SqlException) {
          // Log an event in the Application Event Log.
          throw;
        }
      }
    }

    private object ID;

    private string lastName;
    public string LastName {
      get { return lastName; }
      set { lastName = value; }
    }

    private string firstName;
    public string FirstName {
      get { return firstName; }
      set { firstName = value;  }
    }

    private string title;
    public String Title {
      get { return title; }
      set { title = value; }
    }

    private string titleOfCourtesy;
    public string Courtesy {
      get { return titleOfCourtesy; }
      set { titleOfCourtesy = value; }
    }

    private int    reportsTo;
    public int Supervisor {
      get { return reportsTo; }
      set { reportsTo = value; }
    }

    public bool Save () {
      return true;
    }
  }

  internal class NorthwindDataException: Exception {
    public NorthwindDataException(string msg) : base (msg) { }
  }
}
Imports System.Collections
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace Samples.AspNet.VB
'
' EmployeeLogic is a stateless business object that encapsulates
' the operations you can perform on a NorthwindEmployee object.
' When the class is written in Visual Basic, you cannot use the Shared
' part.
Public Class EmployeeLogic
   ' Returns a collection of NorthwindEmployee objects.
   Public Shared Function GetAllEmployees() As ICollection
      Dim al As New ArrayList()

      Dim cts As ConnectionStringSettings = ConfigurationManager.ConnectionStrings("NorthwindConnection")
      Dim sds As New SqlDataSource(cts.ConnectionString, "SELECT EmployeeID FROM Employees")
      Try
         Dim IDs As IEnumerable = sds.Select(DataSourceSelectArguments.Empty)

         ' Iterate through the Enumeration and create a
         ' NorthwindEmployee object for each ID.
         For Each row As DataRowView In IDs
            Dim id As String = row("EmployeeID").ToString()
            Dim nwe As New NorthwindEmployee(id)
            ' Add the NorthwindEmployee object to the collection.
            al.Add(nwe)
         Next
      Finally
         ' If anything strange happens, clean up.
         sds.Dispose()
      End Try

      Return al
   End Function 'GetAllEmployees

   Public Shared Function GetEmployee(anID As Object) As NorthwindEmployee
      Return New NorthwindEmployee(anID)
   End Function 'GetEmployee


   Public Shared Sub UpdateEmployeeInfo(ne As NorthwindEmployee)
      Dim retval As Boolean = ne.Save()
      If Not retval Then
         Throw New NorthwindDataException("UpdateEmployee failed.")
      End If
   End Sub

   Public Shared Sub DeleteEmployee(ne As NorthwindEmployee)
   End Sub

End Class


Public Class NorthwindEmployee


   Public Sub New()
      ID = DBNull.Value
      aLastName = ""
      aFirstName = ""
      aTitle = ""
      titleOfCourtesy = ""
      reportsTo = - 1
   End Sub


   Public Sub New(anID As Object)
      Me.ID = anID
      Dim cts As ConnectionStringSettings = ConfigurationManager.ConnectionStrings("NorthwindConnection")
      Dim conn As New SqlConnection(cts.ConnectionString)
      Dim sc As New SqlCommand(" SELECT FirstName,LastName,Title,TitleOfCourtesy,ReportsTo " & _
                               " FROM Employees " & _
                               " WHERE EmployeeID = @empId", conn)
      ' Add the employee ID parameter and set its value.
      sc.Parameters.Add(New SqlParameter("@empId", SqlDbType.Int)).Value = Int32.Parse(anID.ToString())
      Dim sdr As SqlDataReader = Nothing

      Try
         conn.Open()
         sdr = sc.ExecuteReader()

         ' This is not a while loop. It only loops once.
         If Not (sdr Is Nothing) AndAlso sdr.Read() Then
            ' The IEnumerable contains DataRowView objects.
            Me.aFirstName = sdr("FirstName").ToString()
            Me.aLastName = sdr("LastName").ToString()
            Me.aTitle = sdr("Title").ToString()
            Me.titleOfCourtesy = sdr("TitleOfCourtesy").ToString()
            If Not sdr.IsDBNull(4) Then
               Me.reportsTo = sdr.GetInt32(4)
            End If
         Else
            Throw New NorthwindDataException("Data not loaded for employee id.")
         End If
      Finally
         Try
            If Not (sdr Is Nothing) Then
               sdr.Close()
            End If
            conn.Close()
         Catch se As SqlException
            ' Log an event in the Application Event Log.
            Throw
         End Try
      End Try
   End Sub

   Private ID As Object

   Private aLastName As String
   Public Property LastName() As String
      Get
         Return aLastName
      End Get
      Set
         aLastName = value
      End Set
   End Property

   Private aFirstName As String
   Public Property FirstName() As String
      Get
         Return aFirstName
      End Get
      Set
         aFirstName = value
      End Set
   End Property

   Private aTitle As String
   Public Property Title() As String
      Get
         Return aTitle
      End Get
      Set
         aTitle = value
      End Set
   End Property

   Private titleOfCourtesy As String
   Public Property Courtesy() As String
      Get
         Return titleOfCourtesy
      End Get
      Set
         titleOfCourtesy = value
      End Set
   End Property
   Private reportsTo As Integer

   Public Property Supervisor() As Integer
      Get
         Return reportsTo
      End Get
      Set
         reportsTo = value
      End Set
   End Property

   Public Function Save() As Boolean
      Return True
   End Function 'Save
End Class


Friend Class NorthwindDataException
   Inherits Exception

   Public Sub New(msg As String)
      MyBase.New(msg)
   End Sub
End Class
End Namespace

설명

항목 내용

소개

ObjectDataSource 컨트롤의 사용자가 만든 클래스를 사용 하 여 작동 합니다. 검색 하 고 데이터를 업데이트 하는 메서드를 만들고 해당 메서드의 이름을 제공 하는 ObjectDataSource 태그에서 제어 합니다. 렌더링 또는 포스트백 처리 하는 동안는 ObjectDataSource 지정한 메서드를 호출 합니다.

시각적으로 렌더링 되지 있는지는 ObjectDataSource 제어 합니다. 결과적으로 ObjectDataSource 와 같은 시각적 기능 지원 하지 않습니다는 EnableTheming 또는 SkinID 속성입니다.

용도

매우 일반적인 애플리케이션 디자인 방법은 프레젠테이션 계층 비즈니스 논리에서 분리 하는 데 비즈니스 개체의 비즈니스 논리를 캡슐화 합니다. 이러한 비즈니스 개체는 프레젠테이션 계층과 데이터 계층에는 3 계층 애플리케이션 아키텍처에서 결과 사이는 고유한 계층을 형성 합니다. ObjectDataSource 컨트롤을 사용 하면 개발자가 자신의 3 계층 애플리케이션 아키텍처를 유지 하는 동안 ASP.NET 데이터 소스 컨트롤을 사용 하도록 합니다.

ObjectDataSource 컨트롤 리플렉션을 사용 하 여 비즈니스 개체의 인스턴스 만들기 및를 검색 하도록의 메서드를 호출, 삽입, 데이터 업데이트 및 삭제 합니다. 합니다 TypeName 클래스의 이름을 식별 하는 ObjectDataSource 작동 합니다. ObjectDataSource ; 보유 하지 않는 개체가 메모리에 웹 요청 수명에 대 한 제어를 만들고 각 메서드 호출에 대 한 클래스의 인스턴스를 소멸 시킵니다. 사용 하는 비즈니스 개체는 많은 리소스가 필요 하거나 만들고 제거 하는 비용이 많이 소요 되는 경우 심각한 고려 사항입니다. 비용이 많이 드는 개체를 사용 하는 최적의 디자인 선택 되지 않을 수 있습니다 하지만 사용 하 여 개체의 수명 주기를 제어할 수 있습니다 합니다 ObjectCreating, ObjectCreated, 및 ObjectDisposing 이벤트입니다.

참고

로 식별 되는 메서드를 SelectMethod, UpdateMethod, InsertMethod, 및 DeleteMethod 속성에는 인스턴스 메서드 일 수 있습니다 또는 static (Shared Visual Basic에서) 메서드. 메서드는 경우 static (Shared Visual Basic에서), 비즈니스 개체의 인스턴스가 만들어지지 않습니다 및 ObjectCreatingObjectCreated, 및 ObjectDisposing 이벤트가 발생 하지 않습니다.

데이터 검색

비즈니스 개체에서 데이터를 검색할 설정의 SelectMethod 속성 데이터를 검색 하는 메서드의 이름입니다. 메서드를 반환 하지 않는 경우는 IEnumerable 또는 DataSet 런타임에서 개체를 래핑할 개체는 IEnumerable 컬렉션입니다. 메서드 시그니처가 있는지 매개 변수를 추가할 수 있습니다 Parameter 개체를 SelectParameters 컬렉션 다음에 의해 지정 된 메서드에 전달 하려는 값에 바인딩합니다는 SelectMethod 속성. 에 대 한 순서로 된 ObjectDataSource 매개 변수를 사용 하 여 컨트롤, 매개 변수 이름 및 메서드 시그니처에서 매개 변수의 형식과 일치 해야 합니다. 자세한 내용은 ObjectDataSource 컨트롤을 사용 하 여 매개 변수를 사용 하 여입니다.

ObjectDataSource 컨트롤 데이터를 검색할 때마다는 Select 메서드가 호출 됩니다. 이 메서드는 지정 된 메서드에 프로그래밍 방식 액세스를 제공 SelectMethod 속성입니다. 지정 된 메서드를 SelectMethod 속성에 바인딩되는 컨트롤에 의해 자동으로 호출 됩니다는 ObjectDataSource 때 해당 DataBind 메서드가 호출 됩니다. 설정 하는 경우는 DataSourceID 데이터 바인딩된 컨트롤의 속성을 컨트롤 자동으로 데이터에 바인딩하는 데이터 원본에서 필요에 따라 합니다. 설정 합니다 DataSourceID 속성은 바인딩에 대 한 권장 되는 메서드는 ObjectDataSource 컨트롤을 데이터 바인딩된 컨트롤입니다. 설정할 수 있습니다 합니다 DataSource 속성인 있지만 명시적으로 호출 해야 합니다 DataBind 데이터 바인딩된 컨트롤의 메서드. 호출할 수 있습니다는 Select 메서드 프로그래밍 방식으로 언제 든 지 데이터를 검색 합니다.

바인딩 데이터 바인딩된 컨트롤을 데이터 소스 컨트롤에 대 한 자세한 내용은 참조 하세요. 데이터 소스 컨트롤을 사용 하 여 데이터에 바인딩합니다.

데이터 작업을 수행합니다.

개체는 비즈니스 기능에 따라는 ObjectDataSource 컨트롤과 함께, 업데이트, 삽입 및 삭제와 같은 데이터 작업을 수행할 수 있습니다. 이러한 데이터 작업을 수행 하려면 적절 한 메서드 이름 및 수행 하려는 작업에 대 한 모든 연결된 매개 변수를 설정 합니다. 예를 들어, 업데이트 작업을 설정 합니다 UpdateMethod 속성을 추가 및 업데이트를 수행 하는 비즈니스 개체 메서드의 이름에 필요한 매개 변수가 UpdateParameters 컬렉션입니다. 경우는 ObjectDataSource 제어와 데이터 바인딩된 컨트롤을 연결 된 매개 변수는 데이터 바인딩된 컨트롤에 의해 추가 됩니다. 이 경우 메서드의 매개 변수 이름은 데이터 바인딩된 컨트롤의 필드 이름이 일치 하는지 확인 해야 합니다. 업데이트가 수행 되는 경우는 Update 메서드가 호출 되는 데이터 바인딩된 컨트롤에 의해 코드에서 명시적으로 또는 자동으로 합니다. 동일한 일반 패턴에 대 한 뒤 DeleteInsert 작업 합니다. 비즈니스 개체는 일괄 처리 되지 않고 한 번에 이러한 유형의 데이터 작업에 대 한 하나의 레코드를 수행할 것으로 간주 됩니다.

데이터 필터링

ObjectDataSource 컨트롤에서 검색 된 데이터를 필터링 할 수는 SelectMethod 데이터로 반환 되 면 속성을 DataSet 또는 DataTable 개체입니다. 설정할 수 있습니다 합니다 FilterExpression 속성 형식을 사용 하 여 필터링 식에 구문 문자열 및 값에 지정 된 매개 변수 식에 바인딩하는 FilterParameters 컬렉션입니다.

캐싱

하지만 ObjectDataSource 인스턴스를 유지 하지 않는 여러 요청에서 비즈니스 개체의으로 식별 되는 메서드 호출의 결과 캐시할 수 있습니다는 SelectMethod 속성. 데이터는 캐시에서 후속 호출을 Select 비즈니스 개체를 만들고 호출 하는 대신 캐시 된 데이터를 반환 하는 메서드 해당 SelectMethod 리플렉션을 사용 하 여 합니다. 개체를 만들고 웹 서버의 메모리 데이터 메서드를 호출을 방지할 수 캐싱 있습니다. ObjectDataSource 자동으로 데이터를 캐시 경우는 EnableCaching 속성이로 설정 되어 true, 및 CacheDuration 속성 캐시 삭제 되기 전에 캐시 데이터를 저장 하는 시간 (초) 수로 설정 됩니다. 지정할 수도 있습니다는 CacheExpirationPolicy 속성과 선택적 SqlCacheDependency 속성입니다. 합니다 ObjectDataSource 컨트롤을 사용 하면 모든 유형의 데이터를 캐시할 수 있지만 리소스 또는 여러 요청에 서비스를 공유할 수 없는 상태를 유지 하는 개체를 캐시 하지 않을 (예를 들어, 개방적이 고 SqlDataReader 개체) 이므로 개체의 동일한 인스턴스 여러 요청을 서비스에 사용 됩니다.

기능

다음 표에서의 기능을 설명 합니다 ObjectDataSource 제어 합니다.

기능 요구 사항
선택 설정 된 SelectMethod 비즈니스의 이름으로 속성의 데이터를 선택 하는 메서드를 개체 및에 필요한 매개 변수를 포함할는 SelectParameters 컬렉션 프로그래밍 방식으로 또는 데이터 바인딩된 컨트롤을 사용 하 여 합니다.
정렬 설정 합니다 SortParameterName 속성에 있는 매개 변수의 이름으로는 SelectMethod 정렬 조건을 전달 하는 메서드.
필터링 설정를 FilterExpression 속성을 필터링 식 및 필요에 따라 모든 매개 변수를 추가 합니다 FilterParameters 컬렉션 데이터를 필터링 할 때를 Select 메서드는. 지정 된 메서드를 SelectMethod 속성을 반환 해야 합니다는 DataSet 또는 DataTable합니다.
페이징 데이터 소스 페이징을 지원 하는 경우는 SelectMethod 메서드는 검색할 레코드의 최대 수와 검색할 첫 번째 레코드의 인덱스에 대 한 매개 변수를 포함 합니다. 이러한 매개 변수의 이름은 각각 및 StartRowIndexParameterName 속성에서 MaximumRowsParameterName 설정해야 합니다. 데이터 바인딩된 컨트롤을 자체적으로 페이징을 수행할 수 있습니다 경우에 합니다 ObjectDataSource 컨트롤 페이징으로 지정한 메서드의에서 직접 지원 하지 않습니다는 SelectMethod 속성입니다. 이 작업을 수행 하려면 데이터 바인딩된 컨트롤에 대 한 요구 사항인 하 여 지정 된 메서드가 합니다 SelectMethod 속성을 구현 하는 개체를 반환 합니다 ICollection 인터페이스.
업데이트 설정 된 UpdateMethod 비즈니스의 이름으로 데이터를 업데이트 하는 메서드를 개체 속성과에 필요한 매개 변수를 포함할는 UpdateParameters 컬렉션입니다.
삭제 중 설정 된 DeleteMethod 비즈니스의 이름으로 속성 메서드 또는 데이터를 삭제 하는 함수 개체 및에 필요한 매개 변수를 포함할는 DeleteParameters 컬렉션입니다.
삽입 설정 된 InsertMethod 비즈니스의 이름으로 속성 메서드 또는 데이터를 삽입 하는 함수 개체 및에 필요한 매개 변수를 포함할는 InsertParameters 컬렉션입니다.
캐싱 설정 된 EnableCaching 속성을 true, 및 CacheDurationCacheExpirationPolicy 캐시 된 데이터에 대해 원하는 캐싱 동작에 따라 속성입니다.

참고

사용 하는 경우는 ObjectDataSource 데이터, 클라이언트에서 입력 된 문자열을 삽입 하거나 업데이트할 클래스는으로 자동 변환 되지 클라이언트 culture 형식에서 서버 문화권 형식입니다. 예를 들어, 클라이언트 culture의 날짜 형식으로 DD/MM/YYYY를 지정할 수 있습니다 및 서버에서의 날짜 형식은 MM/DD/YYYY를 수 있습니다. 이런 경우 2009 년 10 월 5 일은에 입력을 TextBox 2009 년 5 월 10으로 제어 하지만 2009 년 5 월 10 일으로 해석 됩니다. 2009 년 10 월 15 일은 15/10/2009을 입력 하 고 잘못 된 날짜로 거부 될 수 있습니다.

데이터 뷰

모든 데이터 소스 컨트롤과 마찬가지로 ObjectDataSource 컨트롤이 데이터 소스 뷰 클래스와 연결 되어 있습니다. 동안 합니다 ObjectDataSource 컨트롤은 데이터를 사용 하는 데 사용 하는 페이지 개발자는 인터페이스를 ObjectDataSourceView 클래스는 데이터 바인딩된 컨트롤을 사용 하는 인터페이스입니다. 또한는 ObjectDataSourceView 클래스는 데이터 소스 컨트롤의 기능을 설명 하 고 실제 작업을 수행 합니다. ObjectDataSource 컨트롤에 연결 된 하나만 ObjectDataSourceView, 이름은 항상 및 DefaultView합니다. 하는 동안 합니다 ObjectDataSourceView 개체에 의해 노출 되는 GetView 메서드를 다양 한 해당 속성과 메서드에 래핑되고에서 직접 노출 된는 ObjectDataSource 컨트롤입니다. 내부적으로 ObjectDataSourceView 개체 검색, 삽입, 업데이트, 삭제, 필터링 및 데이터 정렬 등의 모든 데이터 작업을 수행 합니다. 자세한 내용은 ObjectDataSourceView를 참조하세요.

LINQ to SQL 사용

사용할 수는 ObjectDataSource LINQ to SQL 클래스를 사용 하 여 제어 합니다. 그렇게 하려면 설정의 TypeName 속성을 데이터 컨텍스트 클래스의 이름입니다. 설정할 수도 합니다 SelectMethod, UpdateMethodInsertMethod, 및 DeleteMethod 해당 작업을 수행 하는 데이터 컨텍스트 클래스의 메서드에 메서드. 에 대 한 이벤트 처리기를 만들어야 합니다 ObjectDisposing 데이터 컨텍스트 클래스의 삭제를 취소 하기 위해 이벤트입니다. 이 단계는 필요한 LINQ to SQL에서는 지연 된 실행을 지원 하기 때문에 반면는 ObjectDataSource 컨트롤이 선택 작업 후 데이터 컨텍스트를 삭제 하려고 합니다. LINQ to SQL 클래스 만들기 방법에 대 한 자세한 내용은 참조 하세요. 방법: 만들 LINQ to SQL 클래스를 웹 프로젝트에서합니다. 데이터 컨텍스트 클래스의 삭제를 취소 하는 방법의 예 참조는 ObjectDisposing 이벤트입니다.

Entity Framework를 사용 하 여

사용할 수도 있습니다는 ObjectDataSource Entity Framework를 사용 하 여 제어 합니다. 자세한 내용은 Entity Framework 및 ObjectDataSource 컨트롤을 사용 하 여입니다.

선언 구문

<asp:ObjectDataSource
    CacheDuration="string|Infinite"
    CacheExpirationPolicy="Absolute|Sliding"
    CacheKeyDependency="string"
    ConflictDetection="OverwriteChanges|CompareAllValues"
    ConvertNullToDBNull="True|False"
    DataObjectTypeName="string"
    DeleteMethod="string"
    EnableCaching="True|False"
    EnablePaging="True|False"
    EnableTheming="True|False"
    EnableViewState="True|False"
    FilterExpression="string"
    ID="string"
    InsertMethod="string"
    MaximumRowsParameterName="string"
    OldValuesParameterFormatString="string"
    OnDataBinding="DataBinding event handler"
    OnDeleted="Deleted event handler"
    OnDeleting="Deleting event handler"
    OnDisposed="Disposed event handler"
    OnFiltering="Filtering event handler"
    OnInit="Init event handler"
    OnInserted="Inserted event handler"
    OnInserting="Inserting event handler"
    OnLoad="Load event handler"
    OnObjectCreated="ObjectCreated event handler"
    OnObjectCreating="ObjectCreating event handler"
    OnObjectDisposing="ObjectDisposing event handler"
    OnPreRender="PreRender event handler"
    OnSelected="Selected event handler"
    OnSelecting="Selecting event handler"
    OnUnload="Unload event handler"
    OnUpdated="Updated event handler"
    OnUpdating="Updating event handler"
    runat="server"
    SelectCountMethod="string"
    SelectMethod="string"
    SkinID="string"
    SortParameterName="string"
    SqlCacheDependency="string"
    StartRowIndexParameterName="string"
    TypeName="string"
    UpdateMethod="string"
    Visible="True|False"
>
        <DeleteParameters>
                <asp:ControlParameter
                    ControlID="string"
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    PropertyName="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:CookieParameter
                    ConvertEmptyStringToNull="True|False"
                    CookieName="string"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:FormParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    FormField="string"
                    Name="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:Parameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:ProfileParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    PropertyName="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:QueryStringParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    QueryStringField="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:SessionParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    SessionField="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
        </DeleteParameters>
        <FilterParameters>
                <asp:ControlParameter
                    ControlID="string"
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    PropertyName="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:CookieParameter
                    ConvertEmptyStringToNull="True|False"
                    CookieName="string"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:FormParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    FormField="string"
                    Name="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:Parameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:ProfileParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    PropertyName="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:QueryStringParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    QueryStringField="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:SessionParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    SessionField="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
        </FilterParameters>
        <InsertParameters>
                <asp:ControlParameter
                    ControlID="string"
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    PropertyName="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:CookieParameter
                    ConvertEmptyStringToNull="True|False"
                    CookieName="string"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:FormParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    FormField="string"
                    Name="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:Parameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:ProfileParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    PropertyName="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:QueryStringParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    QueryStringField="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:SessionParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    SessionField="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
        </InsertParameters>
        <SelectParameters>
                <asp:ControlParameter
                    ControlID="string"
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    PropertyName="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:CookieParameter
                    ConvertEmptyStringToNull="True|False"
                    CookieName="string"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:FormParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    FormField="string"
                    Name="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:Parameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:ProfileParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    PropertyName="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:QueryStringParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    QueryStringField="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:SessionParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    SessionField="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
        </SelectParameters>
        <UpdateParameters>
                <asp:ControlParameter
                    ControlID="string"
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    PropertyName="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:CookieParameter
                    ConvertEmptyStringToNull="True|False"
                    CookieName="string"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:FormParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    FormField="string"
                    Name="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:Parameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:ProfileParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    PropertyName="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:QueryStringParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    QueryStringField="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
                <asp:SessionParameter
                    ConvertEmptyStringToNull="True|False"
                    DefaultValue="string"
                    Direction="Input|Output|InputOutput|ReturnValue"
                    Name="string"
                    SessionField="string"
                    Size="integer"
                    Type="Empty|Object|DBNull|Boolean|Char|SByte|
                        Byte|Int16|UInt16|Int32|UInt32|Int64|UInt64|
                        Single|Double|Decimal|DateTime|String"
                />
        </UpdateParameters>
</asp:ObjectDataSource>

생성자

ObjectDataSource()

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

ObjectDataSource(String, String)

지정된 형식 이름과 데이터 검색 메서드 이름을 사용하여 ObjectDataSource 클래스의 새 인스턴스를 초기화합니다.

속성

Adapter

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

(다음에서 상속됨 Control)
AppRelativeTemplateSourceDirectory

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

(다음에서 상속됨 Control)
BindingContainer

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

(다음에서 상속됨 Control)
CacheDuration

SelectMethod 속성으로 검색된 데이터를 데이터 소스 컨트롤에서 캐시하는 시간(초)을 가져오거나 설정합니다.

CacheExpirationPolicy

기간과 결합될 때 데이터 소스 컨트롤에서 사용하는 캐시의 동작을 설명하는 캐시 만료 동작을 가져오거나 설정합니다.

CacheKeyDependency

데이터 소스 컨트롤에서 만든 모든 데이터 캐시 개체에 링크된 사용자 정의 키 종속성을 가져오거나 설정합니다.

ChildControlsCreated

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

(다음에서 상속됨 Control)
ClientID

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

(다음에서 상속됨 DataSourceControl)
ClientIDMode

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

(다음에서 상속됨 DataSourceControl)
ClientIDSeparator

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

(다음에서 상속됨 Control)
ConflictDetection

새 값만 Update 메서드에 전달되는지 아니면 기존 값과 새 값이 모두 Update 메서드에 전달되는지를 확인하는 값을 가져오거나 설정합니다.

Context

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

(다음에서 상속됨 Control)
Controls

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

(다음에서 상속됨 DataSourceControl)
ConvertNullToDBNull

업데이트, 삽입 또는 삭제 작업에 전달되는 Parameter 값이 Value 컨트롤에 의해 null에서 ObjectDataSource 값으로 자동으로 변환되는지 여부를 나타내는 값을 가져오거나 설정합니다.

DataItemContainer

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

(다음에서 상속됨 Control)
DataKeysContainer

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

(다음에서 상속됨 Control)
DataObjectTypeName

데이터 바인딩된 컨트롤의 개별 값을 전달하는 대신 ObjectDataSource 컨트롤에서 데이터 업데이트, 삽입 또는 삭제 작업의 매개 변수로 사용할 클래스의 이름을 가져오거나 설정합니다.

DeleteMethod

ObjectDataSource 컨트롤에서 데이터 삭제를 위해 호출하는 메서드나 함수의 이름을 가져오거나 설정합니다.

DeleteParameters

DeleteMethod 메서드에서 사용하는 매개 변수가 포함된 매개 변수 컬렉션을 가져옵니다.

DesignMode

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

(다음에서 상속됨 Control)
EnableCaching

ObjectDataSource 컨트롤에서 데이터 캐싱이 활성화되어 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

EnablePaging

데이터 소스 컨트롤에서 검색된 데이터 집합을 통해 페이징을 지원하는지 여부를 나타내는 값을 가져오거나 설정합니다.

EnableTheming

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

(다음에서 상속됨 DataSourceControl)
EnableViewState

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

(다음에서 상속됨 Control)
Events

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

(다음에서 상속됨 Control)
FilterExpression

SelectMethod 속성으로 지정된 메서드가 호출될 때 적용되는 필터링 식을 가져오거나 설정합니다.

FilterParameters

FilterExpression 문자열의 모든 매개 변수 자리 표시자와 연결된 매개 변수 컬렉션을 가져옵니다.

HasChildViewState

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

(다음에서 상속됨 Control)
ID

서버 컨트롤에 할당된 프로그래밍 ID를 가져오거나 설정합니다.

(다음에서 상속됨 Control)
IdSeparator

컨트롤 식별자를 구분하는 데 사용되는 문자를 가져옵니다.

(다음에서 상속됨 Control)
InsertMethod

ObjectDataSource 컨트롤에서 데이터 삽입을 위해 호출하는 메서드나 함수의 이름을 가져오거나 설정합니다.

InsertParameters

InsertMethod 속성에서 사용하는 매개 변수가 포함된 매개 변수 컬렉션을 가져옵니다.

IsChildControlStateCleared

이 컨트롤에 포함된 컨트롤이 컨트롤 상태를 가지는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Control)
IsTrackingViewState

서버 컨트롤에서 해당 뷰 상태의 변경 사항을 저장하는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Control)
IsViewStateEnabled

이 컨트롤의 뷰 상태를 사용할 수 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Control)
LoadViewStateByID

인덱스 대신 ID별로 뷰 상태를 로드할 때 컨트롤이 참여하는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Control)
MaximumRowsParameterName

데이터 소스 페이징을 지원하게 위해 검색할 레코드의 수를 나타내는 데 사용되는 비즈니스 개체 데이터 검색 메서드 매개 변수의 이름을 가져오거나 설정합니다.

NamingContainer

동일한 ID 속성 값을 사용하는 서버 컨트롤을 구별하기 위해 고유의 네임스페이스를 만드는 서버 컨트롤의 명명 컨테이너에 대한 참조를 가져옵니다.

(다음에서 상속됨 Control)
OldValuesParameterFormatString

Delete 또는 Update 메서드에 전달된 원래 값에 대한 매개 변수의 이름에 적용할 서식 문자열을 가져오거나 설정합니다.

Page

서버 컨트롤이 들어 있는 Page 인스턴스에 대한 참조를 가져옵니다.

(다음에서 상속됨 Control)
Parent

페이지 컨트롤 계층 구조에서 서버 컨트롤의 부모 컨트롤에 대한 참조를 가져옵니다.

(다음에서 상속됨 Control)
ParsingCulture

DataObjectTypeName이 나타내는 형식의 개체를 생성하기 위해 문자열 값을 실제 속성 형식으로 변환할 때 사용되는 문화권 정보를 나타내는 값을 가져오거나 설정합니다.

RenderingCompatibility

렌더링된 HTML이 호환될 ASP.NET 버전을 지정하는 값을 가져옵니다.

(다음에서 상속됨 Control)
SelectCountMethod

ObjectDataSource 컨트롤이 행 수를 검색할 때 호출하는 메서드나 함수의 이름을 가져오거나 설정합니다.

SelectMethod

ObjectDataSource 컨트롤이 데이터를 검색할 때 호출하는 메서드나 함수의 이름을 가져오거나 설정합니다.

SelectParameters

SelectMethod 속성에 지정된 메서드에서 사용하는 매개 변수의 컬렉션을 가져옵니다.

Site

디자인 화면에서 렌더링될 때 현재 컨트롤을 호스팅하는 컨테이너 관련 정보를 가져옵니다.

(다음에서 상속됨 Control)
SkinID

DataSourceControl 컨트롤에 적용할 스킨을 가져옵니다.

(다음에서 상속됨 DataSourceControl)
SortParameterName

SelectMethod 매개 변수에서 데이터 소스 정렬을 지원하기 위해 정렬 식을 지정하는 데 사용하는 비즈니스 개체의 이름을 가져오거나 설정합니다.

SqlCacheDependency

Microsoft SQL Server 캐시 종속성에 사용할 데이터베이스와 테이블을 지정하는 세미콜론으로 구분된 문자열을 가져오거나 설정합니다.

StartRowIndexParameterName

데이터 소스 페이징을 지원하기 위해 검색할 첫 번째 레코드의 식별자 값을 나타내는 데 사용되는 데이터 검색 메서드 매개 변수의 이름을 가져오거나 설정합니다.

TemplateControl

이 컨트롤이 포함된 템플릿의 참조를 가져오거나 설정합니다.

(다음에서 상속됨 Control)
TemplateSourceDirectory

Page 또는 현재 서버 컨트롤이 들어 있는 UserControl의 가상 디렉터리를 가져옵니다.

(다음에서 상속됨 Control)
TypeName

ObjectDataSource 개체에서 나타내는 클래스의 이름을 가져오거나 설정합니다.

UniqueID

서버 컨트롤에 대해 계층적으로 정규화된 고유 식별자를 가져옵니다.

(다음에서 상속됨 Control)
UpdateMethod

ObjectDataSource 컨트롤이 데이터 업데이트를 위해 호출하는 메서드나 함수의 이름을 가져오거나 설정합니다.

UpdateParameters

UpdateMethod 속성으로 지정된 메서드에서 사용하는 매개 변수가 포함된 매개 변수 컬렉션을 가져옵니다.

ValidateRequestMode

잠재적으로 위험한 값이 있는지 확인하기 위해 컨트롤에서 브라우저의 클라이언트 입력을 검사하는지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 Control)
ViewState

같은 페이지에 대한 여러 개의 요청 전반에 서버 컨트롤의 뷰 상태를 저장하고 복원할 수 있도록 하는 상태 정보 사전을 가져옵니다.

(다음에서 상속됨 Control)
ViewStateIgnoresCase

StateBag 개체가 대/소문자를 구분하는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 Control)
ViewStateMode

이 컨트롤의 뷰 상태 모드를 가져오거나 설정합니다.

(다음에서 상속됨 Control)
Visible

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

(다음에서 상속됨 DataSourceControl)

메서드

AddedControl(Control, Int32)

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

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

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

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

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

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

자식 컨트롤을 저장할 컬렉션을 만듭니다.

(다음에서 상속됨 DataSourceControl)
DataBind()

호출된 서버 컨트롤과 모든 해당 자식 컨트롤에 데이터 원본을 바인딩합니다.

(다음에서 상속됨 Control)
DataBind(Boolean)

DataBinding 이벤트를 발생시키는 옵션을 사용하여, 호출된 서버 컨트롤과 모든 자식 컨트롤에 데이터 소스를 바인딩합니다.

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

데이터 소스를 서버 컨트롤의 자식 컨트롤에 바인딩합니다.

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

DeleteMethod 컬렉션의 매개 변수를 사용하여 DeleteParameters 속성으로 식별되는 메서드를 호출하는 방식으로 삭제 작업을 수행합니다.

Dispose()

서버 컨트롤이 메모리에서 해제되기 전에 해당 서버 컨트롤에서 최종 정리 작업을 수행하도록 합니다.

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

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

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

서버 컨트롤에 자식 컨트롤이 있는지 확인합니다. 서버 컨트롤에 자식 컨트롤이 없으면 자식 컨트롤을 만듭니다.

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

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

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

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

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

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

(다음에서 상속됨 DataSourceControl)
FindControl(String, Int32)

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

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

컨트롤에 대한 입력 포커스를 설정합니다.

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

ObjectDataSource 개체와 연결된 뷰 개체의 목록을 나타내는 이름의 컬렉션을 검색합니다.

HasControls()

서버 컨트롤에 자식 컨트롤이 있는지 확인합니다.

(다음에서 상속됨 DataSourceControl)
HasEvents()

이벤트가 컨트롤이나 자식 컨트롤에 등록되었는지 여부를 나타내는 값을 반환합니다.

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

InsertMethod 속성으로 식별되는 메서드와 InsertParameters 컬렉션의 매개 변수를 호출하여 삽입 작업을 수행합니다.

IsLiteralContent()

서버 컨트롤에 리터럴 내용만 저장되어 있는지 확인합니다.

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

SaveControlState() 메서드에서 저장한 이전 페이지 요청에서 컨트롤 상태 정보를 복원합니다.

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

이전에 저장된 ObjectDataSource 컨트롤의 뷰 상태를 로드합니다.

MapPathSecure(String)

가상 경로(절대 또는 상대)가 매핑되는 실제 경로를 가져옵니다.

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

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
OnBubbleEvent(Object, EventArgs)

서버 컨트롤의 이벤트가 페이지의 UI 서버 컨트롤 계층 구조에 전달되었는지 여부를 확인합니다.

(다음에서 상속됨 Control)
OnDataBinding(EventArgs)

DataBinding 이벤트를 발생시킵니다.

(다음에서 상속됨 Control)
OnInit(EventArgs)

LoadComplete 이벤트 처리기를 ObjectDataSource 컨트롤이 포함된 페이지에 추가합니다.

OnLoad(EventArgs)

Load 이벤트를 발생시킵니다.

(다음에서 상속됨 Control)
OnPreRender(EventArgs)

PreRender 이벤트를 발생시킵니다.

(다음에서 상속됨 Control)
OnUnload(EventArgs)

Unload 이벤트를 발생시킵니다.

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

파일을 읽는 데 사용되는 Stream을 가져옵니다.

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

이벤트 소스와 해당 정보를 컨트롤의 부모 컨트롤에 할당합니다.

(다음에서 상속됨 Control)
RaiseDataSourceChangedEvent(EventArgs)

DataSourceChanged 이벤트를 발생시킵니다.

(다음에서 상속됨 DataSourceControl)
RemovedControl(Control)

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

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

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

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

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

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

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

(다음에서 상속됨 DataSourceControl)
RenderControl(HtmlTextWriter, ControlAdapter)

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

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

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

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

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

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

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

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

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

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

ObjectDataSource컨트롤의 상태를 저장합니다.

Select()

SelectMethod 속성으로 식별되는 메서드를 SelectParameters 컬렉션의 매개 변수와 함께 호출하여 내부 데이터 스토리지에서 데이터를 검색합니다.

SetDesignModeState(IDictionary)

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

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

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

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

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

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

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

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

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

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

ObjectDataSource 컨트롤의 뷰 상태 변경 내용을 StateBag 개체에 저장할 수 있도록 추적합니다.

Update()

UpdateMethod 속성으로 식별되는 메서드와 UpdateParameters 컬렉션의 매개 변수를 호출하여 업데이트 작업을 수행합니다.

이벤트

DataBinding

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

(다음에서 상속됨 Control)
Deleted

Delete() 작업이 완료되면 발생합니다.

Deleting

Delete() 작업 전에 발생합니다.

Disposed

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

(다음에서 상속됨 Control)
Filtering

필터 작업 전에 발생합니다.

Init

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

(다음에서 상속됨 Control)
Inserted

Insert() 작업이 완료되면 발생합니다.

Inserting

Insert() 작업 전에 발생합니다.

Load

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

(다음에서 상속됨 Control)
ObjectCreated

TypeName 속성으로 식별되는 개체가 만들어진 후 발생합니다.

ObjectCreating

TypeName 속성으로 식별되는 개체가 만들어지기 전에 발생합니다.

ObjectDisposing

TypeName 속성으로 식별되는 개체가 삭제되기 전에 발생합니다.

PreRender

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

(다음에서 상속됨 Control)
Selected

Select() 작업이 완료되면 발생합니다.

Selecting

Select() 작업 전에 발생합니다.

Unload

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

(다음에서 상속됨 Control)
Updated

Update() 작업이 완료되면 발생합니다.

Updating

Update() 작업 전에 발생합니다.

명시적 인터페이스 구현

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

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

(다음에서 상속됨 DataSourceControl)
IDataSource.GetView(String)

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

(다음에서 상속됨 DataSourceControl)
IDataSource.GetViewNames()

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

(다음에서 상속됨 DataSourceControl)
IExpressionsAccessor.Expressions

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

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

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

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

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

(다음에서 상속됨 DataSourceControl)
IListSource.GetList()

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

(다음에서 상속됨 DataSourceControl)
IParserAccessor.AddParsedSubObject(Object)

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

(다음에서 상속됨 Control)

확장 메서드

FindDataSourceControl(Control)

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

FindFieldTemplate(Control, String)

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

FindMetaTable(Control)

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

GetDefaultValues(IDataSource)

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

GetMetaTable(IDataSource)

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

TryGetMetaTable(IDataSource, MetaTable)

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

적용 대상

추가 정보