I have a grid filled with some data in my silverlight4 app. I want to have "Show this as html" button for the grid.
I can generate the html, export it to savefile dialog, but that's not what i need, because in this way user has to perform more actions, like:
- click 'export'
- enter filename
- wait for download
- find file open it in browser
Is there any way to create tab, or window, or popup wi开发者_JS百科th certain html content in it? (so it would be like
- click 'show as html'
?)
Thanks in advance,
Ilya.
The problem is that you can't save it anywhere locally without user interaction (or elevated privileges).... so don't save it locally.
I can think of two options:
1.
- Write the data back to the server
- Open a normal popup web browser window, pointing a generated temp HTML page.
To open another HTML browser window from Silverlight you can use HtmlWindow.Navigate specifying _blank as the target type.
2.
- Use the ability of Silverlight to execute any Javascript to open a popup with the content.
From Silverlight you can use ScriptObject.Invoke to execute arbitrary Javascript.
精彩评论