Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Here you go for what it's worth. This is code within an Asp.Net control to display book information. You can probably adapt it for your purposes easily enough. Or at least give you a starting-point. If you really want, I'd be happy to bundle the control up and send it your way.</p> <pre><code>if (!(string.IsNullOrEmpty(ISBN) &amp;&amp; string.IsNullOrEmpty(ASIN))) { AWSECommerceService service = new AWSECommerceService(); ItemLookup lookup = new ItemLookup(); ItemLookupRequest request = new ItemLookupRequest(); lookup.AssociateTag = ConfigurationManager.AppSettings["AssociatesTag"]; lookup.AWSAccessKeyId = ConfigurationManager.AppSettings["AWSAccessKey"]; if (string.IsNullOrEmpty(ASIN)) { request.IdType = ItemLookupRequestIdType.ISBN; request.ItemId = new string[] { ISBN.Replace("-", "") }; } else { request.IdType = ItemLookupRequestIdType.ASIN; request.ItemId = new string[] { ASIN }; } request.ResponseGroup = ConfigurationManager.AppSettings["AWSResponseGroups"].Split(new char[] { ' ', ',', ';' }, StringSplitOptions.RemoveEmptyEntries); lookup.Request = new ItemLookupRequest[] { request }; ItemLookupResponse response = service.ItemLookup(lookup); if (response.Items.Length &gt; 0 &amp;&amp; response.Items[0].Item.Length &gt; 0) { Item item = response.Items[0].Item[0]; if (item.MediumImage == null) { bookImageHyperlink.Visible = false; } else { bookImageHyperlink.ImageUrl = item.MediumImage.URL; } bookImageHyperlink.NavigateUrl = item.DetailPageURL; bookTitleHyperlink.Text = item.ItemAttributes.Title; bookTitleHyperlink.NavigateUrl = item.DetailPageURL; if (item.OfferSummary.LowestNewPrice == null) { if (item.OfferSummary.LowestUsedPrice == null) { priceHyperlink.Visible = false; } else { priceHyperlink.Text = string.Format("Buy used {0}", item.OfferSummary.LowestUsedPrice.FormattedPrice); priceHyperlink.NavigateUrl = item.DetailPageURL; } } else { priceHyperlink.Text = string.Format("Buy new {0}", item.OfferSummary.LowestNewPrice.FormattedPrice); priceHyperlink.NavigateUrl = item.DetailPageURL; } if (item.ItemAttributes.Author != null) { authorLabel.Text = string.Format("By {0}", string.Join(", ", item.ItemAttributes.Author)); } else { authorLabel.Text = string.Format("By {0}", string.Join(", ", item.ItemAttributes.Creator.Select(c =&gt; c.Value).ToArray())); } ItemLink link = item.ItemLinks.Where(i =&gt; i.Description.Contains("Wishlist")).FirstOrDefault(); if (link == null) { wishListHyperlink.Visible = false; } else { wishListHyperlink.NavigateUrl = link.URL; } } } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload