Silverlight Asp.Net project integration -
I added a silverlight application to my ASP.NET website. Visual Studio created a new Silverlight project and added its XAP in the ClientBin folder under the project of my website. Therefore both projects are subject to a solution.
My Silverlight app should read an XML file and I was unable to access the file from the client bin folder under the website project. Adding the context of that project does not work because it says that only reference to other Silverlight applications can be added. At present, this work is done when the file is under the Sylilit project, but when this website is not under the project.
How can I file it from a website project?
structure
WEBSITE1 (solution) -WEBSITE1 (project) -clubbin -file 0.xml -silverlightchart.xap -silwarecharch -file 1.xml
< / Pre>I can use file1.xml
XDocument document = XDocument.Load ("file1.xml");
I want to access file0.xml, but no path works for me, for example,
XDocument document = XDocument.Load ( "~ / ClientBin / file0.xml");
and WEBSITE1 is a startup project
You must be enabled To read the file from the ClientBin folder, without the need to just do something special, on an estimate, I would say that you have accidentally set the Silverlight application as a startup project. In this scenario, if you want the website to be a startup project, then have either the Silverlight app test page marked as the start page or navigate to the Silverlight page after the browser starts. Edit Does. Therefore, passing a urine in the load method will only work if Uri can be completed by material in Expedition. Thats why an XML file works in the Silverlight project because it ends in Xap.
To get the Xml from the site, you need to: -
WebClient Client = new webclient (); Client.DownloadStringCompleted + = (S, RGS) = & gt; {XDocument Document = XDocument.Load (args.result); SomeFunctionToContinueWithDocumentProcess (document); } Client.DownloadStringAsync (The new URI ("file0.xml", UriKind.Relative); // passes here, but _document will not be loaded yet
Comments
Post a Comment