lamaM91 / google-api-for-dotnet

Automatically exported from code.google.com/p/google-api-for-dotnet
0 stars 0 forks source link

Cannot access "TbImage" property when using Eval("TbImage.Url") #50

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. bind a IImageResult to a ListView in asp.net
In code behide file:
GimageSearchClient imgClient = new GimageSearchClient(MY_WEBSITE_URL);
IList<IImageResult> imgResults = imgClient.Search(filter, 5);
lvGoogleImage.DataSource = imgResults;
lvGoogleImage.DataBind();

2. In .aspx file. All the other properties can be accessed by Eval.
E.g. <%# Eval("Title") %> can display the title.
But when using <%# Eval("TbImage.Url") %>, it receives an error:
Google.API.Search.GimageResult' does not contain a property with the name 
'TbImage'.

3. What is the expected output? What do you see instead?
I would like the get the TbImage.Url property by calling Eval() in .aspx 
page. I can access that property in code behide file.

What version of the product are you using? On what operating system?
I'm using GoogleSearchAPI.dll 0.4 version. Using windows os and vs 2010 
(.net 4 framework)

Please provide any additional information below.

Original issue reported on code.google.com by sun52...@gmail.com on 16 May 2010 at 7:39

GoogleCodeExporter commented 8 years ago
Hi sun,

Please read the document about IImageResult and TbImage.Url.

And make sure the TbImage.Url is correct. (copy and paste to your browser, and 
see if
there is a picture)

If the url is OK. Try use this url string but not bind the IImageResult (it is a
interface, so I'm not sure it will word correctly)

IL

Original comment by iron9li...@gmail.com on 17 May 2010 at 3:56

GoogleCodeExporter commented 8 years ago
Thanks for your comment IL,

Yes, the TbImage.Url property is correct when accessed in the .cs file. E.g.
imgResults[0].TbImage.Url does have the value. 

And I can access the Image property of INewsResult by <%# Eval("Image")%> which 
is 
also an interface (INewsImage Image { get; })

All these properties are exist and can be seen in the debug. Please have a look 
at 
the attached pictures. Hope they can help.

BTW, thank you very much for working on this Google search API library.

SUn

Original comment by sun52...@gmail.com on 17 May 2010 at 2:54

Attachments:

GoogleCodeExporter commented 8 years ago
Hi sun,
I said "I'm not sure it will work correctly"

p.s. may I ask you why you use VS2010 and .NET4? for new MVC?

Original comment by iron9li...@gmail.com on 17 May 2010 at 3:47

GoogleCodeExporter commented 8 years ago
any solution on this sun??? I am getting the same issue> I know its been quite 
a long time now.

Original comment by abhisal1...@gmail.com on 12 Jan 2012 at 1:40