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 August 10th, 2011, 12:50 PM
Authorized User
 
Join Date: Aug 2010
Posts: 50
Thanks: 7
Thanked 0 Times in 0 Posts
Default Parse Error on Chapter 14 pg 523

Hi I keep getting this error message in the last tryitout in Chapter 14. I cant figure out what the issue is. Please help. Thanks

Server Error in '/Site' Application.
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message: The server tag is not well formed.

Source Error:

Line 17: <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("ImageUrl") %>'
Line 18: ToolTip='<%# Eval("ToolTip") %>' />
Line 19: <asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval('Description') %>' />
Line 20: </li>
Line 21: </ItemTemplate>
 
Old August 10th, 2011, 01:17 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,

Take a look at this:

Code:
 
Text='<%# Eval('Description') %>' />
Description should be enclosed with double quotes, not single quotes.

Cheers,

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 August 10th, 2011, 02:16 PM
Authorized User
 
Join Date: Aug 2010
Posts: 50
Thanks: 7
Thanked 0 Times in 0 Posts
Default

I see it now, thanks. Can you explain a little more why we need doubke quotes instead of single quotes. Thansk.
 
Old August 10th, 2011, 02:35 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

It's because the value for the Text property already uses single quotes. If you use single quotes for the Description as well, the compiler thinks the Text property ends where it encounters the first sigle property. E.g. you end up with:

Code:
Text='<%# Eval('
followed by a meaningless:

Code:
Description') %>' />
Hope this helps,

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!
The Following User Says Thank You to Imar For This Useful Post:
Jhalad (September 9th, 2014)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 14 Exercise 3 Solution pg 747 arodrigu12 BOOK: Beginning ASP.NET 4 : in C# and VB 2 April 21st, 2011 07:58 PM
chapter 14 Try It Out pg 505 step #4 arodrigu12 BOOK: Beginning ASP.NET 4 : in C# and VB 3 April 21st, 2011 02:28 PM
Chapter 5 Parse Error razorack BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 2 February 6th, 2005 10:43 AM





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