DynamicDataManager.RegisterControl Método

Definición

Registra un DynamicDataManager control.

Sobrecargas

Nombre Description
RegisterControl(Control)

Registra un control con el DynamicDataManager control .

RegisterControl(Control, Boolean)

Registra un control con el DynamicDataManager control .

RegisterControl(Control)

Registra un control con el DynamicDataManager control .

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)

Parámetros

control
Control

Control de datos que se va a registrar.

Ejemplos

En el ejemplo siguiente se muestra cómo registrar un control />

<%@ 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>

Comentarios

Para habilitar el comportamiento dinámico en un control, debe registrarlo.

Se aplica a

RegisterControl(Control, Boolean)

Registra un control con el DynamicDataManager control .

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)

Parámetros

control
Control

Control de datos que se va a registrar.

setSelectionFromUrl
Boolean

true para usar la clave principal para establecer el elemento seleccionado; De lo contrario, no se establece el elemento seleccionado.

Comentarios

El registro del control permite su comportamiento dinámico. Si el setSelectionFromUrl parámetro es true y el valor de clave principal se encuentra en los valores de ruta, se usará la clave principal para establecer el elemento seleccionado. El valor de clave principal normalmente se pasa en la ruta mediante la cadena de consulta en la dirección URL de la solicitud.

Se aplica a