Home All Groups Group Topic Archive Search About
Author
14 Dec 2006 8:37 PM
greatdane
Hi:
Show quoteHide quote
> I need some help achieving the following:
> I have an ASP.net app and this app allows to open several web pages with a
> target ="_blank" on its own ie window.
>
> I want to close all the prior windows open on a click event of a button on
> my main page.
>
> Thanks
> Nancy.

Author
15 Dec 2006 4:07 PM
Patrice
AFAIK you can' for pages opened this way. The browser will issue a warning
to ask the permission to the user (the rule is that a script is not able to
close a window opened by the user without asking for permission, it can
close only windows opened using scripting).

So what should work would be to open those windows uisng window.open that
returns a reference to the opened window (and you'll be able to close using
this reference).

It's perhaps likely better also to try to keep the opened window to a
minimum (youc ould perhaops use tabs or whatever could fit your navigation
need).
--

"greatdane" <greatd***@discussions.microsoft.com> a écrit dans le message de
news: F07FBBBD-F02B-4575-A77A-21BBB8EBA***@microsoft.com...
Show quoteHide quote
> Hi:
>> I need some help achieving the following:
>> I have an ASP.net app and this app allows to open several web pages with
>> a
>> target ="_blank" on its own ie window.
>>
>> I want to close all the prior windows open on a click event of a button
>> on
>> my main page.
>>
>> Thanks
>> Nancy.
>
>
Author
15 Dec 2006 4:52 PM
greatdane
Thanks for responding.   I am using the <asp:hyperlink ... to open my *.aspx
pages.
Do I have to change the way I open the pages?


Show quoteHide quote
"Patrice" wrote:

> AFAIK you can' for pages opened this way. The browser will issue a warning
> to ask the permission to the user (the rule is that a script is not able to
> close a window opened by the user without asking for permission, it can
> close only windows opened using scripting).
>
> So what should work would be to open those windows uisng window.open that
> returns a reference to the opened window (and you'll be able to close using
> this reference).
>
> It's perhaps likely better also to try to keep the opened window to a
> minimum (youc ould perhaops use tabs or whatever could fit your navigation
> need).
> --
>
> "greatdane" <greatd***@discussions.microsoft.com> a écrit dans le message de
> news: F07FBBBD-F02B-4575-A77A-21BBB8EBA***@microsoft.com...
> > Hi:
> >> I need some help achieving the following:
> >> I have an ASP.net app and this app allows to open several web pages with
> >> a
> >> target ="_blank" on its own ie window.
> >>
> >> I want to close all the prior windows open on a click event of a button
> >> on
> >> my main page.
> >>
> >> Thanks
> >> Nancy.
> >
> >
>
>
>
Author
19 Dec 2006 9:18 AM
Patrice
AFAIK yes, you'll have to use window.open client side (that is if you want
to get rid of the confirmation dialog).

See :
http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/open_0.asp

To close the window you'll use anyway window.close :
(http://msdn.microsoft.com/library/default.asp?url=/workshop/author/dhtml/reference/methods/close_0.asp).

"Invoking the window.close method on a window not opened with script
displays a confirmation dialog box. Using script to close the last running
instance of Microsoft Internet Explorer also opens the confirmation dialog
box. "

--
Patrice

"greatdane" <greatd***@discussions.microsoft.com> a écrit dans le message de
news: 1B22EC82-F475-4B7A-B6C0-E65D9D3EF***@microsoft.com...
Show quoteHide quote
> Thanks for responding.   I am using the <asp:hyperlink ... to open my
> *.aspx
> pages.
> Do I have to change the way I open the pages?
>
>
> "Patrice" wrote:
>
>> AFAIK you can' for pages opened this way. The browser will issue a
>> warning
>> to ask the permission to the user (the rule is that a script is not able
>> to
>> close a window opened by the user without asking for permission, it can
>> close only windows opened using scripting).
>>
>> So what should work would be to open those windows uisng window.open that
>> returns a reference to the opened window (and you'll be able to close
>> using
>> this reference).
>>
>> It's perhaps likely better also to try to keep the opened window to a
>> minimum (youc ould perhaops use tabs or whatever could fit your
>> navigation
>> need).
>> --
>>
>> "greatdane" <greatd***@discussions.microsoft.com> a écrit dans le message
>> de
>> news: F07FBBBD-F02B-4575-A77A-21BBB8EBA***@microsoft.com...
>> > Hi:
>> >> I need some help achieving the following:
>> >> I have an ASP.net app and this app allows to open several web pages
>> >> with
>> >> a
>> >> target ="_blank" on its own ie window.
>> >>
>> >> I want to close all the prior windows open on a click event of a
>> >> button
>> >> on
>> >> my main page.
>> >>
>> >> Thanks
>> >> Nancy.
>> >
>> >
>>
>>
>>