CS1502: invalid arguments - DataBinder.Eval

J

j-in-uk

According to research, I should convert to ToString() on my aspx but
that does not seem to work in this case. Any ideas?

CS1502: The best overloaded method match for
'AlbumForm.GetThumbnailTitleHtml(Photo)' has some invalid arguments

ASPX Page
<td>#
GetThumbnailTitleHtml(DataBinder.Eval(Container.DataItem,"Photos(0)"))
%></td>
<td>#
GetThumbnailTitleHtml(DataBinder.Eval(Container.DataItem,"Photos(1)"))
%></td>

CODE BEHIND
public class PageData
{
public Photo[] _photos = new Photo[4];
// return photo array (four elements)
public Photo[] Photos
{
get { return _photos; }
}
}

public string GetThumbnailTitleHtml(Photo photo)
{
if (photo == null)
{return "&nbsp;"; }
return string.Format("<a
href=\"photo.aspx?album={0}&photo={1}\"><font class='txt-photo-
links'>{2}</font></a>",
HttpUtility.UrlPathEncode(_albumList.SelectedAlbum),photo.Title);
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top