Databases Reference
In-Depth Information
Listing 6.1 shows the source code of the Details page template, Details.aspx , located in
the DynamicData\PageTemplates folder of the web application. Most of its contents should
be already familiar to you from Chapter 2, “Entity Framework,” and Chapter 4, “Entity
Templates.”
LISTING 6.1 Details Page Template (Markup)
<%@ Page Language=”C#”
MasterPageFile=”~/Site.master” CodeBehind=”Details.aspx.cs”
Inherits=”WebApplication.DynamicData.PageTemplates.Details” %>
<asp:Content ContentPlaceHolderID=”main” runat=”Server”>
<asp:DynamicDataManager runat=”server”>
<DataControls>
<asp:DataControlReference ControlID=”formView” />
</DataControls>
</asp:DynamicDataManager>
<h2>Entry from table <%= table.DisplayName %></h2>
<asp:UpdatePanel runat=”server”>
<ContentTemplate>
<asp:ValidationSummary runat=”server” HeaderText=”List of validation errors”/>
<asp:DynamicValidator runat=”server” ControlToValidate=”formView”
Display=”None” />
<asp:FormView runat=”server” ID=”formView” DataSourceID=”dataSource”
OnItemDeleted=”FormView_ItemDeleted”>
<ItemTemplate>
<asp:DynamicEntity runat=”server” />
<div class=”DDFormActions”>
<asp:DynamicHyperLink runat=”server” Action=”Edit” Text=”Edit” />
<asp:LinkButton runat=”server” CommandName=”Delete” Text=”Delete”
OnClientClick='return
confirm(“Are you sure you want to delete this item?”);'/>
<asp:DynamicHyperLink runat=”server” Action=”List” Text=”Back to List”/>
</div>
</ItemTemplate>
</asp:FormView>
<asp:EntityDataSource ID=”dataSource” runat=”server” EnableDelete=”true” />
<asp:QueryExtender TargetControlID=”dataSource” runat=”server”>
<asp:DynamicRouteExpression />
</asp:QueryExtender>
Search WWH ::




Custom Search