Powered by MSDN

US - English
NEW! Silverlight 5 is available Learn More

  • benji2

    benji2

    Member

    9 Points

    9 Posts

    Re: Access clientside data island?

    May 13, 2008 12:39 AM | LINK

    Hi Sam,

    >The SilverLight Way:  Grab the XML data/file/webservice from wherever it is on the server

    I think there are a lot of scenarios where exposing data from the server (say via a web service) makes sense. I imagine a scenario where the user can interact with the silverlight control and request a different set of data. However, in my circumstance, the control will only display data, and there will be no possibility of needing to query for another set of data.

    That being said, with option 1 you suggest, the ASP.NET page is rendered, and once the client loads the page (and the SL control), it will generate another request (to the web service exposing the data). With option number two, there is no additional (web service) request; the page is rendered once and the client already has everything handed to it to display the page and the SL control.

    >I prefer to do all of my processing(when possible) in C# rather than Javascript(faster and easier to debug).

    I completely agree. I may be missing something though: In either circumstance I think I'd be using C# clientside. I would still envision using LINQ to XML in either circumstance to load the XML into an object for the SL object to consume. Also, I think that there is a managed API which is callable from SL used for accessing the clientside DOM.

    I was reading somewhere that XML data islands are only supported in IE and should be avoided. Perhaps there are alternate solutions to this. Maybe somehow pushing a temporary xml file to the browser?

    Thanks for the response.

    -Ben