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