So, I want to create some Silverlight charts from some data on my ASP.NET web page. The way to do this, either using Visifire (my current thing) or the upcoming Silverlight
The really easy solution to this is to just do the table/data presentation in silverlight too. Then use a webservice to provide the data to your silverlight app.
I'm sure MS endorse this wholly.
Otherwise (and you asked for it ;):
The problem with the ideal solution you've provided is that the abstraction of ASP.Net is hiding the reality of double posting for the data as well as building a client interface on the server when the client-side silverlight app can do it perfectly well itself:
Step 1 - Send html to client with data embedded
Step 2 - Initialize a client side application (silverlight app)
Step 3 - Press button calling the GenerateXamlFromData on the server
Step 4 - Get the same data as step 1 and then create some Xaml from it
step 5 - Pass it back to browser
Step 6 - Call a method in the Silverlight application to set the Xaml
Steps 3-5 are totally redundant. On the client you already have the data and something capable of creating charts on the fly, the silverlight app.
If there were an absolute requirement for the table to be in html, the way I would solve it is:
Make your data non-html. Use XML/XSLTransform, JSON/javascript/JQuery, or whatever your favourite client-side transform is to render it. Webservices, whatever. Key thing is here that you open your webpage, http post back for the data and create your html table on the fly. Then pass the same data to you silverlight app and have it create the chart.
Your silverlight application can dynamically build your chart through simple object creation. If you really like poking yourself in the eye with a pencil, you can still dynamically build strings of Xaml and use those to create the chart objects instead, an easy way of earning the StackOverflow badge of Xaml-Nazi
There's still yet another solution to your problem, if you really wanted to you could just pass the Sivlerlight App the html table dom and extract the data from that instead. Generally speaking unless you've done something really stupid html tables conform to XML so just load it into an XDocument.
As for the simple way you describe, afaik it's not possible atm. Maybe one day it will be, but to be honest it will never be a good solution, it will just be a solution for people who want to hack together quick and dirty apps.