Amit
Amit

Reputation: 26276

how to read config from xml in silverlight?

Hi I use Silverlight 3 and .net 3.5

I have a config file in xml which is the the following format

<applicationlist>
<application>
    <el1>test1</el1>
    <el2>http://localhost/1</el2>
    <el3>http://localhost/2</el3>
    <el4>http://localhost/3</el4>
</application>
</applicationlist>

I want to store this config file in the host web application and read from the silverlight application. But since silverlight has many access restrictions, i could not achieve this. Any idea how i can proceed?

Upvotes: 1

Views: 1060

Answers (2)

Amit
Amit

Reputation: 26276

I ultimately used the approach mentioned here

http://www.kirupa.com/blend_silverlight/loading_xml_sl2_pg1.htm

Upvotes: 2

Sorskoot
Sorskoot

Reputation: 10310

If the xml file is in the same domain as your silverlight application you can load the xml using the XmlReader.Create method.

Note that if the xml file is not on the same domain, make sure you add a clientaccesspolicy.xml file to you domain.

Upvotes: 0

Related Questions