Photo.Title not property

Topics: User Forum
Sep 29, 2006 at 8:11 PM
Greetings once again.

I am attempting to use a PhotoCollection in an ASP:DataList control. I can access the Url properties fine, but when attempting to output the Title, I get an error:

DataBinding: 'FlickrNet.Photo' does not contain a property with the name 'Title'.

Upon examination of the source, it seems that this is in fact a field, and not a property. I'm going to try and recompile the source myself and add a property, but this may be something you want to add for future releases, since databinding seems to only work with properties.

Sep 29, 2006 at 8:17 PM
An update on my own post :)

In Photo.cs, I changed the Title code as follows:

(original code)

/// <remarks/>
XmlAttribute("title", Form=XmlSchemaForm.Unqualified)
public string Title;

(modified code)

private string m_title;

/// <remarks/>
XmlAttribute("title", Form=XmlSchemaForm.Unqualified)
public string Title
{
get { return m_title; }
set { m_title = value; }
}

Hope that helps! It works for me and I can now access the Title while databinding to a PhotoCollection.