tags:

views:

45

answers:

1

Hi, I am creating a popupwindow for login like the following

pageHandle = HtmlPage.PopupWindow(new Uri("http://localhost/somepage.aspx")

Now I need to close that window aftter login in completed. How to do it?

A: 

Similar to a JavaScript-issue "window.close", you might be able to issue pageHandle.close().

However, not if this would be cross-site scripting: your application (.xap) and the popup page you navigate to need to be in the same domain, so unless that "localhost" is the same as the app's host, this won't work.

Jeff Wilcox
Hi Jeff, Thanks for the reply.. I can't find any Close method in that handle. So what I am doing currently is with pure javascript HtmlPage.Window.Eval function. and then closing it when necessery. And yes my popup page is also in same domain .. so basically it is working but it seems a bit hacky to use eval than to have strongly typed support...
Tanmoy
So, you won't find a strongly typed Close method; you'll need to either use Invoke on the managed object, calling "close", or use the Eval method.
Jeff Wilcox