开发者

Display popup without security warning

开发者 https://www.devze.com 2022-12-09 19:36 出处:网络
I use Silverlight and I\'m trying to get some data to the user side. I can easily display PDF file with an <embed> tag in the browser.

I use Silverlight and I'm trying to get some data to the user side. I can easily display PDF file with an <embed> tag in the browser.

However, I also have to be able to save files form the server. I tried the SaveFileDialog from Silvelright but it doesn't allow setting the file name (which is an issue).

I tried setting a hidden <iframe> source to the URL from the server but that triggers a security warning and it's not good either (there would be too many cl开发者_运维百科ueless users calling because it doesn't work).

I tried calling window.open to trigger a new popup set to the URL. That works OK but again there's a security warning.

Is it possible to get rid of that security message? I know it's possible in Javascript. An exampel is on the site http://livetecs.com (go to the live demo, then project manager and open a report in a new window: no security warning!)

How do they achieve that behavior?

If there's any other way to get my reports saved Silverlight I'd be very interested to hear about them.

EDIT: The warning I'm talking about is the Pop-up blocked. To see this pop-up or additional options click here.. banner appearing on top of the page.

Cheers.


There is no way around the pop up blocker when you open up a window without a user action. If there was a way around that, than the pop up blockers would be useless.

Only way to avoid the security message is to have the users add your site to their safe list.


OK, after much fiddling I came accross the Silverlight built-in pop-up window that I couldn't use before.

The only limitation is that it can only be triggered by a user action (which is fine in this context() PopUpWindow at MSDN

It fits the bill perfectly and I couldn't use it before because I wanted to pre-generate the report files before opening the pop-up (and thus I wasn't in a user event context anymore).

I'm going to create a report generation page that will display a status message and then show the report (I haven't worked out yet how I'll do that though).

0

精彩评论

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