DynamicDataSite/MyProducts.aspx
(开头部分) 5KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<%@ Page Language="C#" MasterPageFile="~/Site.master" CodeFile="MyProducts.aspx.cs"
Inherits="MyProducts" Title="以 Products 表为例,演示动态数据的应用" %>
<%@ Register Assembly="System.Web.Entity, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
Namespace="System.Web.UI.WebControls" TagPrefix="asp" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
<asp:DynamicDataManager ID="DynamicDataManager1" runat="server" AutoLoadForeignKeys="true" />
<h2>
以 Products 表为例,演示动态数据的应用</h2>
<asp:FormView ID="FormView1" runat="server" DataSourceID="FormDataSource" AllowPaging="True"
DataKeyNames="ProductId">
<ItemTemplate>
<table>
<tr>
<td>
ProductId:
</td>
<td>
<!--DynamicField - 显示指定的动态数据字段,相当于 BoundField-->
<!--DynamicControl - 通过指定的字段模板显示指定的动态数据字段-->
<asp:DynamicControl ID="ProductId" runat="server" DataField="ProductId" />
</td>
</tr>
<tr>
<td>
ProductName:
</td>
<td>
<asp:DynamicControl ID="ProductName" runat="server" DataField="ProductName" />
</td>
</tr>
<tr>
<td>
UnitPrice:
</td>
<td>
<asp:DynamicControl ID="UnitPrice" runat="server" DataField="UnitPrice" />
</td>
</tr>
<tr>
<td colspan="2">
<asp:LinkButton ID="InsertButton" runat="server" CommandName="New" CausesValidation="false"
Text="New" />
<asp:LinkButton ID="EditButton" runat="server" CommandName="Edit" CausesValidation="false"
Text="Edit" />
<asp:LinkButton ID="DeleteButton" runat="server" CommandName="Delete" CausesValidation="false"
Text="Delete" />
</td>
</tr>
</table>
</ItemTemplate>
<EditItemTemplate>
<table>
<tr>
<td>
ProductId:
</td>
<td>
<asp:DynamicControl ID="ProductId" runat="server" DataField="ProductId" Mode="ReadOnly" />
</td>
后面还有 59 行代码,解锁后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
