troubleshooting Question

response of Webclient (URL is an xml file)

Avatar of at999
at999 asked on
1 Comment1 Solution574 ViewsLast Modified:
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)
                        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
Luis Pérez
Software Architect in .Net

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 1 Comment.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 1 Comment.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros