Note that there are some explanatory texts on larger screens.

plurals
  1. POUnknown error using Digg API and URI handler (silverlight)
    primarykey
    data
    text
    <p>For class we have to follow a tutorial to create a silverlight website that searches DIGG for a given topic. (Using this tutorial as a base: <a href="http://weblogs.asp.net/scottgu/archive/2010/02/22/first-look-at-silverlight-2.aspx" rel="nofollow">http://weblogs.asp.net/scottgu/archive/2010/02/22/first-look-at-silverlight-2.aspx</a>)</p> <p>We have to use the following code to fetch the information from DIGG.</p> <pre><code> private void buttonSearch_Click(object sender, RoutedEventArgs e) { string topic = textboxSearchTopic.Text; WebClient digg = new WebClient(); digg.DownloadStringCompleted += new DownloadStringCompletedEventHandler(digg_DownloadStringCompleted); digg.DownloadStringAsync( new Uri("http://services.digg.com/1.0/story.getAll?count=10&amp;topic="+topic)); } void digg_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e) { if (e.Error != null) { DisplayStories(e.Result); } } private void DisplayStories(string xmlContent) { XDocument document = XDocument.Parse(xmlContent); var stories = from story in document.Descendants("story") where story.Element("thumbnail")!=null select new DiggStory { Id = (string)story.Attribute("id"), Title = (string)story.Element("title"), Description = (string)story.Element("description"), ThumbNail = (string)story.Element("thumbnail").Attribute("src"), HrefLink = (string)story.Attribute("link"), NumDiggs = (int)story.Attribute("diggs") }; gridStories.ItemsSource = stories; } </code></pre> <p>And when bushing the buttonSearch, We get the error: </p> <pre><code>An exception occurred during the operation, making the result invalid. Check InnerException for exception details. at System.ComponentModel.AsyncCompletedEventArgs.RaiseExceptionIfNecessary() at System.Net.OpenReadCompletedEventArgs.get_Result() at DiggSample.Views.Search.Digg_OpenReadCompleted(Object sender, OpenReadCompletedEventArgs e) at System.Net.WebClient.OnOpenReadCompleted(OpenReadCompletedEventArgs e) at System.Net.WebClient.OpenReadOperationCompleted(Object arg) </code></pre> <p>I already know the Digg API is outdated, but I do not think this error has anything to do with it. (We even get a local XML file, which we can use but it still doesn't work)</p> <p>I have no idea what is causing this and we aren't get much help from our teacher, so I hope somebody can help us.</p> <p>Thanks, Thomas</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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