 |
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
|
|
|
|
|

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

June 3rd, 2012, 03:24 PM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
Hi there,
What's the name of that column in the database? Maybe you capitalized it differently (for example: id instead of Id)?
Imar
|
|

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

June 4th, 2012, 12:47 PM
|
|
Registered User
|
|
Join Date: Jun 2012
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
|
|
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.
|
|

June 5th, 2012, 06:12 AM
|
 |
Wrox Author
|
|
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
|
|
>>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
|
|
 |
|