RegisterStartupScript & Window.Open

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

In my Page_Load I call a RegisterStartupScript. I know its getting called.
Yet, its not opening the page. I tried to open a regular .html file as well.
Same problem.
I know I can open 1. popup windows. I tested this with a whole different
application and it works fine. (different calling and receiving page though).
And the bummer is that it used to work last year when I last worked on this.
I'm sure of it. I even grabbed the same codebase to test with.
What am I missing?
I even saved the resultant page, and I can see my code in there.... (the new
code is at the very bottom.

Dim popupScript As String = "<script language='JavaScript'>" & _
"window.open('RtFileResult.aspx', '', " & _
"'width=750, height=580,
scrollbars,status,menubar,resizable,toolbar,titlebar,location');" & _
"</script>"

Page.RegisterStartupScript("PopupScript", popupScript)
 
the builtin popup blockers in browsers, detect this code, and prevent it
from running. if you need this code, you need to get your users to mark your
site as allowing popups.

-- bruce (sqlwork.com)
 
Any good ideas for workarounds using code? I get the feeling that
RegisterStartupScript should probably not be used for opening new windows?

I'm also trying to find a place here in IE that turns that on and off. Could
it instead be something within Windows itself (I just updated to XP-SP2 and
think that might have changed things)
 
XP-SP2 installed the feature in IE. you can turn off popup blocking for you
site. you should open the window from a client click event instead of
posting back.

-- bruce (sqlwork.com)
 
Yes. I understand. But in my case, I need the click event to first execute
code on the serverside. Then, depending upon the results, I either open a
brand new window, or refresh the current window with an error message. Is
there an easy way to do this?
Karen
 
Back
Top