Skip to main content
Home Forums Silverlight Programming Report a Silverlight Bug Safari pop up windows problem in silverlight 2
5 replies. Latest Post by prithwish.ghosh on August 26, 2008.
(0)
kashifimran
Member
74 points
46 Posts
05-08-2008 10:23 AM |
I am trying to open a pop window from silverlight app which than loads a new aspx page. It works with IE and Firefox but gives error in Safari. Below is the C# code that is inside button click event handler and after that is the javascript code to open pop up window. I took javascript from one Joe Stagner's blogs. I have tried it on both windows and mac and Safari does not seem to work on either one.
try
{
}
myScriptMethod.InvokeSelf(ex.Message);
<
var updated="";function wopen(url, name, w, h){// Fudge factors for window decoration space.
w += 32;
h += 96;
wleft = (screen.width - w) / 2;
wtop = (screen.height - h) / 2;
w = screen.width;
wleft = 0;
h = screen.height;
wtop = 0;
name,
win.resizeTo(w, h);
win.moveTo(wleft, wtop);
win.focus();
// -->
</
05-08-2008 10:51 AM |
I also tried HyperLinkButton and it works on safari if you are navigating in the same window. If you set TargetName="New" IE and Firefox open link in new window. Safari does not do anything again on both windows and mac.
Yi-Lun L...
All-Star
25052 points
2,747 Posts
05-13-2008 3:07 AM |
Hello, are you using Safari on Windows or Mac? Currently only Safari on Mac is supported. Safari on Windows may work fine for some Silverlight applications, but not all, especially if you use a lot of scripts...
05-13-2008 12:26 PM |
It does not work on both mac or pc. I noticed if I call a function from SL that in turn invoke a button's click event and if my open window logic is inside button's click event handler then it works.
//Calling stub javascrtip from silverlightHtmlPage.Window.Invoke("Stub");
In host asp.net page I have fowlling javascript and a hidden button.
//Stub invoke btnSafari's click eventfunction Stub() //Test function{var btn = document.getElementById('btnSafari');if(btn != null) btn.click();}
//Hidden button to open pop up in safari.<input id="btnSafari" style="visibility: hidden; height: 0px; width: 0px;" type="button" onclick="pop(); return false;" />
05-13-2008 12:28 PM |
Following does not work for safari
//Calling stub javascrtip from silverlightHtmlPage.Window.Invoke("pop");
prithwis...
8 points
4 Posts
08-26-2008 10:29 AM |
You are talking about the popup. My whole application is not running in Safari....
Please help me out....