In my application I am using following code
page1.aspx:
page1.aspx.cs:
var objects = new JavaScriptSerializer().Deserialize(json);
Array arryobjects = new JavaScriptSerializer().Deserialize(json);
int mycount = arrobjects.Length;
for (int i = 0; i< mycount; i++)
{
filename_photo = objects[i]["filename"];
url1 = objects[i]["url"];
dtlist.DataSource = listItems;
dtlist.DataBind();
Photo photod = new Photo(photo, url1);
listItems.Add(photodetails);
}
and create a class:
public class photo
{
string photo { get; set; }
string url1 { get; set; }
public Photo(string photo, string url1)
{
this.photo = photo;
this.url1 = url1;
}
}
this code giving me run time error:
[System.Web.HttpException] = {"DataBinding: 'Photos.Photo' does not contain a property with the name 'url1'."} or
[System.Web.HttpException] = {"DataBinding: 'Photos.Photo' does not contain a property with the name 'photo'."}
can any one explain me what is wrong in my code?
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Lakshmanan Sethu SankaranarayanRank #124 · 17.7K reputationPosted Apr 9, 2014, 9:02 PM EDT
Can you try debugging and tell me the line where it throws the error?
piya p79 reputationPosted Apr 9, 2014, 9:07 PM EDT