Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
Password Reminder
Register
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old April 21st, 2011, 12:24 PM
Registered User
Points: 35, Level: 1
Points: 35, Level: 1 Points: 35, Level: 1 Points: 35, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2011
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 14 Exercise 3 Solution pg 747

The following code, although it works, produces the error below:

<ItemTemplate>
<li>
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl='<%# "PictureDetails.aspx?Id=" + Eval("Id").ToString() %>'>
<asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("ImageUrl") %>' ToolTip='<%# Eval("ToolTip") %>' />
</asp:HyperLink>
<asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval("Description") %>' />
</li>

Any suggestions on how to get rid of the this error message??

Error 1 Overload resolution failed because no accessible 'ToString' can be called with these arguments:
'Public Shared Function ToString(value As Long, toBase As Integer) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As Long, toBase As Integer) As String': Value of type 'System.Globalization.CultureInfo' cannot be converted to 'Integer'.
'Public Shared Function ToString(value As Integer, toBase As Integer) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As Integer, toBase As Integer) As String': Value of type 'System.Globalization.CultureInfo' cannot be converted to 'Integer'.
'Public Shared Function ToString(value As Short, toBase As Integer) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As Short, toBase As Integer) As String': Value of type 'System.Globalization.CultureInfo' cannot be converted to 'Integer'.
'Public Shared Function ToString(value As Byte, toBase As Integer) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As Byte, toBase As Integer) As String': Value of type 'System.Globalization.CultureInfo' cannot be converted to 'Integer'.
'Public Shared Function ToString(value As String, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As Date, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As Decimal, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As Double, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As Single, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As ULong, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As Long, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As UInteger, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As Integer, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As UShort, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As Short, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As Byte, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As SByte, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As Char, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As Boolean, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'.
'Public Shared Function ToString(value As Object, provider As System.IFormatProvider) As String': Argument not specified for parameter 'value'. C:\BegASPNETVB\Site\PhotoAlbums\Default.aspx 1 1 C:\BegASPNETVB\Site\
Reply With Quote
  #2 (permalink)  
Old April 21st, 2011, 12:55 PM
Imar's Avatar
Wrox Author
Points: 72,055, Level: 100
Points: 72,055, Level: 100 Points: 72,055, Level: 100 Points: 72,055, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,086
Thanks: 80
Thanked 1,587 Times in 1,563 Posts
Default

Hi there,

When I copy and paste your code into my Planet Wrox application it works fine, so the problem must be elsewhere.

Are you sure the markup is causing the error and not some code in the code behind? And is Id an int in your database?

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!
Reply With Quote
  #3 (permalink)  
Old April 21st, 2011, 07:58 PM
Registered User
Points: 35, Level: 1
Points: 35, Level: 1 Points: 35, Level: 1 Points: 35, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2011
Posts: 8
Thanks: 1
Thanked 0 Times in 0 Posts
Default Chapter 14 Exercise 3 Solution pg 747

Imar,

After I received your reply, I restarted VWD to follow your suggestions, only to discover that the problem I reported earlier is gone, just as mysteriously as it appeared. I can only surmise that the problem was transitory in nature and attributable, perhaps, to some quirk of VWD itself. It is not the first time that I have encountered inexplicable errors that go away upon doing a build or restarting VFW. Hurrah!

Thanks for your prompt response,

Al Rodriguez.
Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 14 Exercise 3 and solution. UncleJeff BOOK: Beginning ASP.NET 4 : in C# and VB 2 March 14th, 2011 02:15 PM
Chapter 3 Exercise 4 Solution KurtBergman BOOK: Beginning Visual C# 2010 8 July 16th, 2010 08:13 PM
Chapter 3 - Exercise 4 - Solution gives no output Cryotic BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5 2 April 19th, 2010 08:57 AM
Solution to exercise 7, Chapter 2 Nick Y BOOK: Ivor Horton's Beginning Visual C++ 2005 0 May 28th, 2006 04:28 AM
C#: Chapter 14 - Exercise 3 Tchami BOOK: Beginning ASP.NET 1.0 0 November 26th, 2003 02:48 PM



All times are GMT -4. The time now is 11:20 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.