Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 26th, 2010, 09:26 AM
Authorized User
Points: 267, Level: 5
Points: 267, Level: 5 Points: 267, Level: 5 Points: 267, Level: 5
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2010
Posts: 56
Thanks: 17
Thanked 2 Times in 2 Posts
Default Ch14 Page 500 Step 10

The code for NewPhotoAlbums.aspx dows not contain any "BoundField's.

Might I have done something wrong or is this another "bug" that I should report?

My generated code for NewPhotoAlbums.aspx
Code:
<%@ Page Title="Create New Photo Album" Language="C#" MasterPageFile="~/MasterPages/Frontend.master" AutoEventWireup="true" CodeFile="NewPhotoAlbum.aspx.cs" Inherits="_NewPhotoAlbum" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
  <asp:DetailsView ID="DetailsView1" runat="server" 
    DataSourceID="EntityDataSource1" DefaultMode="Insert" Height="50px" Width="125px">
    <Fields>
      <asp:CommandField ShowInsertButton="True" />
    </Fields>
  </asp:DetailsView>
  <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
    ConnectionString="name=PlanetWroxEntities" 
    DefaultContainerName="PlanetWroxEntities" EnableFlattening="False" 
    EnableInsert="True" EntitySetName="Photoalbums">
  </asp:EntityDataSource>
</asp:Content>

Your source code for NewPhotoAlbums.aspx
Code:
<%@ Page Title="Create New Photo Album" Language="C#" MasterPageFile="~/MasterPages/Frontend.master" AutoEventWireup="true" CodeFile="NewPhotoAlbum.aspx.cs" Inherits="_NewPhotoAlbum" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" runat="Server">
  <asp:DetailsView ID="DetailsView1" runat="server" AutoGenerateRows="False" DataKeyNames="Id" DataSourceID="EntityDataSource1" DefaultMode="Insert" Height="50px" Width="125px">
    <Fields>
      <asp:BoundField DataField="Id" HeaderText="Id" ReadOnly="True" SortExpression="Id" InsertVisible="False" />
      <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
      <asp:CommandField ShowInsertButton="True" />
    </Fields>
  </asp:DetailsView>
  <asp:EntityDataSource ID="EntityDataSource1" runat="server" ConnectionString="name=PlanetWroxEntities" DefaultContainerName="PlanetWroxEntities" EnableFlattening="False" EnableInsert="True" EntitySetName="PhotoAlbums" OnInserted="EntityDataSource1_Inserted">
  </asp:EntityDataSource>
</asp:Content>
 
Old October 26th, 2010, 02:54 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

That might be the case. What happens when you clear and reassign the data source (optionally refresh its structure), or when you bring up the Edit Fields dialog?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!





Similar Threads
Thread Thread Starter Forum Replies Last Post
page 167 Issue with Step 10. iPhoneNoob BOOK: Beginning iPhone SDK Programming with Objective-C 1 July 26th, 2010 11:49 AM
chapter 3 page 89: HTTP 500 internal server error igtoroy BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 7 February 23rd, 2010 11:08 AM
page 656 step 10 results in HTTP 403 error message Dan Cern BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 September 2nd, 2009 03:40 PM
Page 222 Step 5 Whitney Schopf BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 1 November 6th, 2006 06:43 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.