Avatar of at999
at999
 asked on

response of Webclient (URL is an xml file)

I have a silverlight application with the Web project and the actual silverlight project...

In the webproject i have created a configuration file - myconfig.xml

Now, in my silverlight project I have written this code(to read myconfig.xml in the web site  of the webproject) after the InitializeComponent(); in the MainPage.xaml.cs

      WebClient webClient = new WebClient();
                              webClient.DownloadStringCompleted += new DownloadStringCompletedEventHandler(webClient_DownloadStringCompleted);
                              webClient.DownloadStringAsync(new Uri(myconfigfile.xml, UriKind.Relative));


The callback "download complete" is written like this -
public void webClient_DownloadStringCompleted(object sender, DownloadStringCompletedEventArgs e)
            {
                  try
                  {
                        var resultXML = XElement.Parse(e.Result);
                  }
                  catch { }
            }


Now how can I guarantee that e.Result will be a string of XML content?
 
Do I have to do any setting on my ASP.NET server or on the browser?

I want to make sure my code will work on any IIS server :) and Internet explorer
pl help
thanks
WCF

Avatar of undefined
Last Comment
Luis Pérez

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Luis Pérez

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23