p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning ASP.NET 4 : in C# and VB (http://p2p.wrox.com/forumdisplay.php?f=560)
-   -   Chapter 14 Exercise 3 Solution pg 747 (http://p2p.wrox.com/showthread.php?t=83375)

arodrigu12 April 21st, 2011 12:24 PM

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\

Imar April 21st, 2011 12:55 PM

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

arodrigu12 April 21st, 2011 07:58 PM

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.


All times are GMT -4. The time now is 04:54 AM.

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