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 June 3rd, 2012, 12:18 PM
Registered User
 
Join Date: Jun 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 15 p.572 problem

I got an error as following...

DataBinding: '<>f__AnonymousType0`4[[System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[System.Boolean, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]]' does not contain a property with the name 'Id'.

Source Error:


Line 6: <asp:Repeater ID="Repeater1" runat="server">
Line 7: <ItemTemplate>
Line 8: <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl='<%# "ViewDetails.aspx?ReviewId=" + Eval("Id").ToString() %>' Text='<%# Eval("Title") %>'></asp:HyperLink>
Line 9: <br />
Line 10: </ItemTemplate>

Please help...I have check several time and still couldn't find out why it doesn't work. Finally, I used the source code that I download from wrox web site, but still doesn't work.

Nge277
 
Old June 3rd, 2012, 03:24 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

What's the name of that column in the database? Maybe you capitalized it differently (for example: id instead of Id)?

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!
 
Old June 4th, 2012, 10:34 AM
Registered User
 
Join Date: Jun 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Nope, Id column in the database is capitalized. and also I 've checked it to make sure that I follow the steps in your textbook. And also check in the new page called ViewDetails.aspx in the Reviews folder.

Last edited by nge277; June 4th, 2012 at 11:02 AM..
 
Old June 4th, 2012, 12:47 PM
Registered User
 
Join Date: Jun 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Never mind Imar...I have solved my problem. I found out my problem in code behind of Reviews/All.aspx.cs. I was trying out some of the features in creating an anonymous types topic and in that topic is renames the Id as Number on page 492. No wonder why, it doesn't work....Thank you anyway.

PS. Your book is the great book so far, I am going to buy the professional version.
 
Old June 5th, 2012, 06:12 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

>>and in that topic is renames the Id as Number

Ah, that explains it ;-)

>> PS. Your book is the great book so far,

Good to hear; thanks.

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
Chapter 15 - p535 - Try It Out problem JohnB BOOK: Beginning ASP.NET 4 : in C# and VB 2 August 10th, 2010 09:53 AM
chapter 15 problem golfbird BOOK: Beginning Visual C++ 6 7 September 9th, 2008 12:29 PM
Chapter 15 problem PhilM BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 16 March 10th, 2008 02:46 PM
Chapter 15 Problem rsearing BOOK: Beginning ASP.NET 2.0 and Databases 3 October 12th, 2006 02:59 PM
A new chapter 15 problem with BBcodes PhilM BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 September 11th, 2004 11:11 PM





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