开发者

Is there any way to open new tab(or popup, or window) with certain html content in silverlight?

开发者 https://www.devze.com 2023-04-07 03:43 出处:网络
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 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:

  1. click 'export'
  2. enter filename
  3. wait for download
  4. 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

  1. 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.

0

精彩评论

暂无评论...
验证码 换一张
取 消