DynamicDataManager.RegisterControl Method (Control)

 

Registers a control with the DynamicDataManager control.

Namespace:   System.Web.DynamicData
Assembly:  System.Web.DynamicData (in System.Web.DynamicData.dll)

public void RegisterControl(
	Control control
)

Parameters

control
Type: System.Web.UI.Control

The data control to register.

To enables dynamic behavior in a control, you must register it.

The following example shows how to register a System.Web.UI.WebControls.GridView control in the Page_Init method of an ASP.NET Web page.


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

.NET Framework
Available since 3.5
Return to top
Show: