Showing posts with label ups. Show all posts
Showing posts with label ups. Show all posts

Thursday, March 29, 2012

Pop Ups

Hi

I am using a popup, I launch the popup from a form, the user then choses an item on the popup, which is put into a session variable and then another form is launched. This works OK except the original form which launched the popup is still open how do I close it when the popup is launch. I use the code below to launch the popup

Dim sTempAsString

sTemp = "<script>window.open('LPopUpContractor.aspx',null,'top=150,left=250,height=150,width=450,status=yes,scrollbars=yes,toolbar=yes,menubar=yes,location=no');</script>"

Response.Write(sTemp)

Response.Flush()

Thanks

Louisa

Hi,
you can close the form from its container window,
<!-- Put this script in MyMainForm.aspx -->
<script type="text/javascript">
window.open('myPopupForm.aspx');
window.close();
</script>

or let the popup close the window that launched it,
<!-- Put this script in myPopupForm.aspx -->
<script type="text/javascript">
if(window.opener) {
window.opener.close();
}
</script>

This works brillantly, but I now get a popup before mine saying:

The Web page you are viewing is trying to close the window

Do you want to close this window?

I click on the yes and my popup appears, how do I get rid of the error msg popup?

Thanks

Louisa


Hi,
it is not an error message popup, it is an Internet Explorer security setting that prevents a script to close a window that wasn't opened by the script itself, without the user permission... well, it seems that a workaround exists for Internet Explorer, just try to set the window.opener property to some value. For example
<script type="text/javascript">
window.opener = this;
window.open('myPopup.aspx');
window.close();
</script>

but I'm not sure it will work on all browsers.


Hi,

The above doesn't seem to work for me as it just puts the pages into a loop, can I not close a previous page from the page load of the new page, when the new page is fully loaded?

Thanks

Louisa


Hi,
I don't know if a workaround exists for the security popup. Try to post this question in theClient Side Web Develoment section of these forums.

a little discussion about that same pop-up

http://forums.asp.net/962609/ShowPost.aspx


Hi,
thanks for posting the link, onewisehobbit.

pop ups

Is there any way to programmatically open pop ups with SP2? My ASP.NET site
uses JavaScript to open new browser windows and they are being shut down
automatically...Pop up blockers don't block windows that are opened by the same domain as
the page that is loaded.

"mareal" <m@.m.com> wrote in message
news:2E000184-7628-4DA2-9906-0ECCE1C93C75@.microsoft.com...
> Is there any way to programmatically open pop ups with SP2? My ASP.NET
> site
> uses JavaScript to open new browser windows and they are being shut down
> automatically...
Thank you Scott. I am not sure I am following. My browser even blocks
Microsoft pop ups from this forum unless I allow them.

I was hoping to find some kind of command to allow my site to open new
browser windows (overwriting pop ups directives)

"Scott M." wrote:

> Pop up blockers don't block windows that are opened by the same domain as
> the page that is loaded.
> "mareal" <m@.m.com> wrote in message
> news:2E000184-7628-4DA2-9906-0ECCE1C93C75@.microsoft.com...
> > Is there any way to programmatically open pop ups with SP2? My ASP.NET
> > site
> > uses JavaScript to open new browser windows and they are being shut down
> > automatically...
>
The pop ups you get from various web sites (including MS) don't actually
have content that comes from the domain you are visiting. Most companies
have special servers dedicated to just serving up the advertising content
(ad servers). For example, the content of a popup ad that you got while
visiting cnn.com might actually be coming from http://ads.cnn.com and the
content of the popup windows you get while visiting Microsoft's web site
might actually be coming from http://ads.microsoft.com.

When you build a web page that includes the window.open() client-side
scripting command that doesn't mean that a popup blocker will prevent that
window from opening. Most popup blockers look to see where the content of
that new window is coming from. If it is from the same domain as the page
that launched it, the popup will be allowed, if not it won't.

For example, visit this page that I built and run for my son's cub scout
pack (http://pack96.org/Calendar/PackCalendar.aspx) and click on one of the
links. You will see that the popup windows do not get blocked even though
your popup blocker is on.

-Scott

"mareal" <m@.m.com> wrote in message
news:DD978129-4376-435E-8F35-C4F80209AD1F@.microsoft.com...
> Thank you Scott. I am not sure I am following. My browser even blocks
> Microsoft pop ups from this forum unless I allow them.
> I was hoping to find some kind of command to allow my site to open new
> browser windows (overwriting pop ups directives)
> "Scott M." wrote:
>> Pop up blockers don't block windows that are opened by the same domain as
>> the page that is loaded.
>>
>> "mareal" <m@.m.com> wrote in message
>> news:2E000184-7628-4DA2-9906-0ECCE1C93C75@.microsoft.com...
>> > Is there any way to programmatically open pop ups with SP2? My ASP.NET
>> > site
>> > uses JavaScript to open new browser windows and they are being shut
>> > down
>> > automatically...
>>
>>
>

pop ups not working

Hi

i am working on a project which involves pop up windows to enter information which worked fine at uni

i brought the exact same project home and the popups dont 'popup, nothing happens

i've allowed popups in internet explorer, but they still dont work

is there something else i've overlooked??

cheers!!

hehe

sorry for wasting space

just remembered i took a line of code out just before i left uni yesterday that stopped popups working

blah!!

pop ups

Is there any way to programmatically open pop ups with SP2? My ASP.NET site
uses JavaScript to open new browser windows and they are being shut down
automatically...Pop up blockers don't block windows that are opened by the same domain as
the page that is loaded.
"mareal" <m@.m.com> wrote in message
news:2E000184-7628-4DA2-9906-0ECCE1C93C75@.microsoft.com...
> Is there any way to programmatically open pop ups with SP2? My ASP.NET
> site
> uses JavaScript to open new browser windows and they are being shut down
> automatically...
Thank you Scott. I am not sure I am following. My browser even blocks
Microsoft pop ups from this forum unless I allow them.
I was hoping to find some kind of command to allow my site to open new
browser windows (overwriting pop ups directives)
"Scott M." wrote:

> Pop up blockers don't block windows that are opened by the same domain as
> the page that is loaded.
> "mareal" <m@.m.com> wrote in message
> news:2E000184-7628-4DA2-9906-0ECCE1C93C75@.microsoft.com...
>
>
The pop ups you get from various web sites (including MS) don't actually
have content that comes from the domain you are visiting. Most companies
have special servers dedicated to just serving up the advertising content
(ad servers). For example, the content of a popup ad that you got while
visiting cnn.com might actually be coming from http://ads.cnn.com and the
content of the popup windows you get while visiting Microsoft's web site
might actually be coming from http://ads.microsoft.com.
When you build a web page that includes the window.open() client-side
scripting command that doesn't mean that a popup blocker will prevent that
window from opening. Most popup blockers look to see where the content of
that new window is coming from. If it is from the same domain as the page
that launched it, the popup will be allowed, if not it won't.
For example, visit this page that I built and run for my son's cub scout
pack (http://pack96.org/Calendar/PackCalendar.aspx) and click on one of the
links. You will see that the popup windows do not get blocked even though
your popup blocker is on.
-Scott
"mareal" <m@.m.com> wrote in message
news:DD978129-4376-435E-8F35-C4F80209AD1F@.microsoft.com...
> Thank you Scott. I am not sure I am following. My browser even blocks
> Microsoft pop ups from this forum unless I allow them.
> I was hoping to find some kind of command to allow my site to open new
> browser windows (overwriting pop ups directives)
> "Scott M." wrote:
>