Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 697673
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T03:11:32+00:00 2026-05-14T03:11:32+00:00

I started developing an application in Silverlight that was dealing with downloading the HTML

  • 0

I started developing an application in Silverlight that was dealing with downloading the HTML of a website and then parsing it. With Silverlight 4 this can be achieved easily by simply requesting elevated permissions. With Silverlight 3, however, the only way to get the HTML of a website is via a WebService call. My initial idea was to do the following:

public class Service1
{
    [OperationContract]
    public void GetHtml()
    {
        Uri targetUri = new Uri("http://www.google.com", UriKind.RelativeOrAbsolute);

        WebClient webClient = new WebClient();
        webClient.DownloadStringCompleted += this.WebClient_DownloadStringCompleted;
        webClient.DownloadStringAsync(targetUri);
    }

    private void WebClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
    {

    }
}

However, I realized that as soon as I make the call, which is async as well, from my Silverlight application, there is no way for me to retrieve the HTML of the website. That is why I changed to the following:

public class Service1
{
    [OperationContract]
    public string GetHtml()
    {
        Uri targetUri = new Uri("http://www.google.com", UriKind.RelativeOrAbsolute);

        WebClient webClient = new WebClient();
        return webClient.DownloadString(targetUri);
    }
}

I believe the last approach is not that fine since it will freeze the thread. So, my question, is there a way to achieve the first approach a.k.a. make async call from an async call :). Any help would be greatly appreciated.

Best Regards,
Kiril

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T03:11:32+00:00Added an answer on May 14, 2026 at 3:11 am

    You can achieve your goal by implementig a Duplex Service. There is some useful information about it on the msdn site and a wonderful podcast entry by Mike Taulty. In general, you would have to modify your operation contract by splitting it into two parts. First part would initiate your WebClient download on the server. Then, on the server, after the html has been downloaded, the server would call back a contract that is implemented on the client side with the payload consisting of the required html content.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 500k
  • Answers 500k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I think you could consider GoodData (www.gooddata.com) - a cloud… May 16, 2026 at 2:07 pm
  • Editorial Team
    Editorial Team added an answer function functionname($input){ $sql = mysql_query("SELECT field1,field2 FROM table WHERE field_name… May 16, 2026 at 2:07 pm
  • Editorial Team
    Editorial Team added an answer use GCHandle.Alloc() from System.Runtime.InteropServices: var handles = new GCHandle[arrays.Count]; byte*[]… May 16, 2026 at 2:07 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I started developing simple application in WPF and XAML. I want to try accessign
I've started developing a forum application in PHP on my MVC Framework and I've
I've recently started developing my first serious application which uses a SQL database, and
I've started developing a website in ASP.NET MVC and have taken part in the
I've been developing a C# (WinForms) application that uses the Office 2007 PIAs to
I'm developing a website using SiteFinity in Visual Studio 2008. This is a web
I started developing one Blog Website based on Hibernate and Struts. I was wondering
I have just started developing iPhone applications and I am very confused by how
Recently I started developing a J2ME app prototype. I noticed how difficult it is
I have recently started using Zend Framework. I started developing on my local XAMPP

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.