Share via


DynamicDataManager.RegisterControl 메서드

정의

DynamicDataManager 컨트롤을 등록합니다.

오버로드

RegisterControl(Control)

DynamicDataManager 컨트롤을 사용하여 컨트롤을 등록합니다.

RegisterControl(Control, Boolean)

DynamicDataManager 컨트롤을 사용하여 컨트롤을 등록합니다.

RegisterControl(Control)

DynamicDataManager 컨트롤을 사용하여 컨트롤을 등록합니다.

public:
 void RegisterControl(System::Web::UI::Control ^ control);
public void RegisterControl (System.Web.UI.Control control);
member this.RegisterControl : System.Web.UI.Control -> unit
Public Sub RegisterControl (control As Control)

매개 변수

control
Control

등록할 데이터 컨트롤입니다.

예제

다음 예제에서는 ASP.NET 웹 페이지의 메서드에서 Page_Init 컨트롤을 등록 System.Web.UI.WebControls.GridView 하는 방법을 보여 있습니다.

<%@ Page Language="C#" MasterPageFile="~/Site.master" %>

<script runat="server">

    protected void Page_Init(object sender, EventArgs e) {
        DynamicDataManager1.RegisterControl(GridView1);
    }

</script>



<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">

    <h1> DynamicDataManager VB Sample</h1>
    
    <asp:DynamicDataManager ID="DynamicDataManager1" runat="server" 
        AutoLoadForeignKeys="true" />
    
    <asp:GridView ID="GridView1" runat="server" DataSourceID="GridDataSource" AllowPaging="True"
        AllowSorting="True" CssClass="gridview">
    </asp:GridView>
    
    <asp:LinqDataSource ID="GridDataSource" runat="server" EnableDelete="true">
       
    </asp:LinqDataSource>
    
</asp:Content>
<%@ Page Language="VB" MasterPageFile="~/Site.master" %>

<script runat="server">

    Protected Sub Page_Init(ByVal sender As Object, ByVal e As EventArgs)
        DynamicDataManager1.RegisterControl(GridView1)
    End Sub

</script>

<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        
<h1> DynamicDataManager CS Sample</h1>

    <asp:DynamicDataManager ID="DynamicDataManager1" runat="server"
         AutoLoadForeignKeys="true" />

    <asp:GridView ID="GridView1" runat="server" DataSourceID="GridDataSource"
        AllowPaging="True" AllowSorting="True" CssClass="gridview">
    </asp:GridView>

    <asp:LinqDataSource ID="GridDataSource" runat="server" EnableDelete="true">
    </asp:LinqDataSource>
    
</asp:Content>

설명

컨트롤에서 동적 동작을 사용하도록 설정하려면 해당 동작을 등록해야 합니다.

적용 대상

RegisterControl(Control, Boolean)

DynamicDataManager 컨트롤을 사용하여 컨트롤을 등록합니다.

public:
 void RegisterControl(System::Web::UI::Control ^ control, bool setSelectionFromUrl);
public void RegisterControl (System.Web.UI.Control control, bool setSelectionFromUrl);
member this.RegisterControl : System.Web.UI.Control * bool -> unit
Public Sub RegisterControl (control As Control, setSelectionFromUrl As Boolean)

매개 변수

control
Control

등록할 데이터 컨트롤입니다.

setSelectionFromUrl
Boolean

기본 키를 사용하여 선택된 항목을 설정하려면 true이고, 그렇지 않으면 선택된 항목이 설정되지 않습니다.

설명

컨트롤을 등록하면 동적 동작이 가능합니다. setSelectionFromUrl 매개 변수가 true 있고 기본 키 값이 경로 값에 있으면 기본 키를 사용하여 선택한 항목을 설정합니다. 기본 키 값은 일반적으로 요청 URL의 쿼리 문자열을 사용하여 경로에 전달됩니다.

적용 대상