DynamicDataManager 类
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
启用支持 ASP.NET 动态数据的 ASP.NET Web 控件的动态行为。
public ref class DynamicDataManager : System::Web::UI::Control
[System.Drawing.ToolboxBitmap(typeof(System.Web.DynamicData.DynamicDataManager), "DynamicDataManager.ico")]
public class DynamicDataManager : System.Web.UI.Control
[System.Drawing.ToolboxBitmap(typeof(System.Web.DynamicData.DynamicDataManager), "DynamicDataManager.bmp")]
public class DynamicDataManager : System.Web.UI.Control
[<System.Drawing.ToolboxBitmap(typeof(System.Web.DynamicData.DynamicDataManager), "DynamicDataManager.ico")>]
type DynamicDataManager = class
inherit Control
[<System.Drawing.ToolboxBitmap(typeof(System.Web.DynamicData.DynamicDataManager), "DynamicDataManager.bmp")>]
type DynamicDataManager = class
inherit Control
Public Class DynamicDataManager
Inherits Control
- 继承
- 属性
以下示例演示如何使用 DynamicDataManager 控件为控件的 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>
本主题内容:
控件 DynamicDataManager 通过以下方式提供数据绑定控件、数据源控件和动态数据之间的粘附:
设置数据绑定控件的字段生成器,以便在 设置为
true
时AutoGenerateColumns创建正确的列集。 数据绑定控件可以是控件 GridView 、 DetailsView 控件或 FormView 控件。设置数据源控件的上下文类型和表名称。 LINQ-to-SQL 的数据源控件为 LinqDataSource。 ADO 实体框架的数据源控件为 EntityDataSource。
AutoGenerateWhereClause如果没有 Where 子句,则为数据源设置 到
true
。将特殊动态参数(例如 DynamicControlParameter )扩展到数据源可以使用的参数。
如果 LINQ-to-SQL AutoLoadForeignKeys 属性设置为
true
,则加载外键。
控件 DynamicDataManager 必须包含在页面上,以便数据控件使用动态数据支持。 控件的 DynamicDataManager 标记必须位于使用动态数据支持的任何控件的标记之前。
备注
DynamicDataManager控件不能放在控件中UpdatePanel。
<asp:DynamicDataManager
AutoLoadForeignKeys="True|False"
EnableQueryStringSelection="True|False"
EnableViewState="True|False"
ID="string"
OnDataBinding="DataBinding event handler"
OnDisposed="Disposed event handler"
OnInit="Init event handler"
OnLoad="Load event handler"
OnPreRender="PreRender event handler"
OnUnload="Unload event handler"
runat="server"
>
</asp:DynamicDataManager>
Dynamic |
初始化 DynamicDataManager 控件的新实例。 |
Adapter |
获取控件的浏览器特定适配器。 (继承自 Control) |
App |
获取或设置包含该控件的 Page 或 UserControl 对象的应用程序相对虚拟目录。 (继承自 Control) |
Auto |
获取或设置一个值,该值指示是否自动为 LINQ-to-SQL 数据上下文加载外键。 |
Binding |
获取包含该控件的数据绑定的控件。 (继承自 Control) |
Child |
获取一个值,该值指示是否已创建服务器控件的子控件。 (继承自 Control) |
ClientID |
获取 ASP.NET 生成的 ClientID 属性。 |
ClientID |
获取由 ASP.NET 生成的 HTML 标记的控件 ID。 (继承自 Control) |
Client |
获取用于生成 ClientID 属性值的算法。 |
Client |
获取或设置用于生成 ClientID 属性值的算法。 (继承自 Control) |
Client |
获取一个字符值,该值表示 ClientID 属性中使用的分隔符字符。 (继承自 Control) |
Context |
为当前 Web 请求获取与服务器控件关联的 HttpContext 对象。 (继承自 Control) |
Controls |
获取 ControlCollection 对象,该对象表示 UI 层次结构中的指定服务器控件的子控件。 (继承自 Control) |
Data |
获取 DynamicDataManager 控件中数据控件引用的列表。 |
Data |
如果命名容器实现 IDataItemContainer,则获取对命名容器的引用。 (继承自 Control) |
Data |
如果命名容器实现 IDataKeysControl,则获取对命名容器的引用。 (继承自 Control) |
Design |
获取一个值,该值指示是否正在使用设计图面上的一个控件。 (继承自 Control) |
Enable |
获取或设置一个值,该值指示主题是否应用于该控件。 (继承自 Control) |
Enable |
获取或设置一个值,该值指示服务器控件是否向发出请求的客户端保持自己的视图状态以及它所包含的任何子控件的视图状态。 (继承自 Control) |
Events |
获取控件的事件处理程序委托列表。 此属性为只读。 (继承自 Control) |
Has |
获取一个值,该值指示当前服务器控件的子控件是否具有任何已保存的视图状态设置。 (继承自 Control) |
ID |
获取或设置分配给服务器控件的编程标识符。 (继承自 Control) |
Id |
获取用于分隔控件标识符的字符。 (继承自 Control) |
Is |
获取一个值,该值指示该控件中包含的控件是否具有控件状态。 (继承自 Control) |
Is |
获取一个值,用于指示服务器控件是否会将更改保存到其视图状态中。 (继承自 Control) |
Is |
获取一个值,该值指示是否为该控件启用了视图状态。 (继承自 Control) |
Load |
获取一个值,该值指示控件是否通过 ID 而不是索引参与加载其视图状态。 (继承自 Control) |
Naming |
获取对服务器控件的命名容器的引用,此引用创建唯一的命名空间,以区分具有相同 ID 属性值的服务器控件。 (继承自 Control) |
Page |
获取对包含服务器控件的 Page 实例的引用。 (继承自 Control) |
Parent |
获取对页 UI 层次结构中服务器控件的父控件的引用。 (继承自 Control) |
Rendering |
获取一个值,该值指定呈现的 HTML 将与之兼容的 ASP.NET 版本。 (继承自 Control) |
Site |
获取容器信息,该容器在呈现于设计图面上时承载当前控件。 (继承自 Control) |
SkinID |
获取或设置要应用于控件的外观。 (继承自 Control) |
Template |
获取或设置对包含该控件的模板的引用。 (继承自 Control) |
Template |
获取包含当前服务器控件的 Page 或 UserControl 的虚拟目录。 (继承自 Control) |
UniqueID |
获取服务器控件的唯一的、以分层形式限定的标识符。 (继承自 Control) |
Validate |
获取或设置指示控件是否检查来自浏览器的客户端输入是否具有潜在危险值的值。 (继承自 Control) |
View |
获取状态信息的字典,这些信息使您可以在同一页的多个请求间保存和还原服务器控件的视图状态。 (继承自 Control) |
View |
获取一个值,该值指示 StateBag 对象是否不区分大小写。 (继承自 Control) |
View |
获取或设置此控件的视图状态模式。 (继承自 Control) |
Visible |
获取一个值,该值指示 DynamicDataManager 控件是否可见。 |
Data |
当服务器控件绑定到数据源时发生。 (继承自 Control) |
Disposed |
当从内存释放服务器控件时发生,这是请求 ASP.NET 页时服务器控件生存期的最后阶段。 (继承自 Control) |
Init |
当服务器控件初始化时发生;初始化是控件生存期的第一步。 (继承自 Control) |
Load |
当服务器控件加载到 Page 对象中时发生。 (继承自 Control) |
Pre |
在加载 Control 对象之后、呈现之前发生。 (继承自 Control) |
Unload |
当服务器控件从内存中卸载时发生。 (继承自 Control) |
IControl |
有关此成员的说明,请参见 ControlBuilder。 (继承自 Control) |
IControl |
有关此成员的说明,请参见 GetDesignModeState()。 (继承自 Control) |
IControl |
有关此成员的说明,请参见 SetDesignModeState(IDictionary)。 (继承自 Control) |
IControl |
有关此成员的说明,请参见 SetOwnerControl(Control)。 (继承自 Control) |
IControl |
有关此成员的说明,请参见 UserData。 (继承自 Control) |
IData |
有关此成员的说明,请参见 DataBindings。 (继承自 Control) |
IData |
有关此成员的说明,请参见 HasDataBindings。 (继承自 Control) |
IExpressions |
有关此成员的说明,请参见 Expressions。 (继承自 Control) |
IExpressions |
有关此成员的说明,请参见 HasExpressions。 (继承自 Control) |
IParser |
有关此成员的说明,请参见 AddParsedSubObject(Object)。 (继承自 Control) |
Find |
返回与指定控件的数据控件关联的数据源。 |
Find |
返回指定控件的命名容器中指定列的字段模板。 |
Find |
返回包含数据控件的元表对象。 |
产品 | 版本 |
---|---|
.NET Framework | 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |