RegisterStartupScript & Window.Open

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • klynn

    RegisterStartupScript & Window.Open

    In my Page_Load I call a RegisterStartup Script. 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='JavaS cript'>" & _
    "window.open('R tFileResult.asp x', '', " & _
    "'width=750 , height=580,
    scrollbars,stat us,menubar,resi zable,toolbar,t itlebar,locatio n');" & _
    "</script>"

    Page.RegisterSt artupScript("Po pupScript", popupScript)

  • Bruce Barker

    #2
    Re: RegisterStartup Script &amp; Window.Open

    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)




    "klynn" <klynn@discussi ons.microsoft.c om> wrote in message
    news:F39BFE45-1680-437C-9D0E-476109A46856@mi crosoft.com...[color=blue]
    > In my Page_Load I call a RegisterStartup Script. 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='JavaS cript'>"
    > & _
    > "window.open('R tFileResult.asp x', '', " & _
    > "'width=750 , height=580,
    > scrollbars,stat us,menubar,resi zable,toolbar,t itlebar,locatio n');" & _
    > "</script>"
    >
    > Page.RegisterSt artupScript("Po pupScript", popupScript)
    >[/color]


    Comment

    • klynn

      #3
      Re: RegisterStartup Script &amp; Window.Open

      Any good ideas for workarounds using code? I get the feeling that
      RegisterStartup Script 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)

      "Bruce Barker" wrote:
      [color=blue]
      > 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)
      >
      >
      >
      >
      > "klynn" <klynn@discussi ons.microsoft.c om> wrote in message
      > news:F39BFE45-1680-437C-9D0E-476109A46856@mi crosoft.com...[color=green]
      > > In my Page_Load I call a RegisterStartup Script. 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='JavaS cript'>"
      > > & _
      > > "window.open('R tFileResult.asp x', '', " & _
      > > "'width=750 , height=580,
      > > scrollbars,stat us,menubar,resi zable,toolbar,t itlebar,locatio n');" & _
      > > "</script>"
      > >
      > > Page.RegisterSt artupScript("Po pupScript", popupScript)
      > >[/color]
      >
      >
      >[/color]

      Comment

      • Bruce Barker

        #4
        Re: RegisterStartup Script &amp; Window.Open

        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)





        "klynn" <klynn@discussi ons.microsoft.c om> wrote in message
        news:021A1B39-0C02-4BB7-AD7E-539B252CFD2A@mi crosoft.com...[color=blue]
        > Any good ideas for workarounds using code? I get the feeling that
        > RegisterStartup Script 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)
        >
        > "Bruce Barker" wrote:
        >[color=green]
        >> 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)
        >>
        >>
        >>
        >>
        >> "klynn" <klynn@discussi ons.microsoft.c om> wrote in message
        >> news:F39BFE45-1680-437C-9D0E-476109A46856@mi crosoft.com...[color=darkred]
        >> > In my Page_Load I call a RegisterStartup Script. 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='JavaS cript'>"
        >> > & _
        >> > "window.open('R tFileResult.asp x', '', " & _
        >> > "'width=750 , height=580,
        >> > scrollbars,stat us,menubar,resi zable,toolbar,t itlebar,locatio n');" & _
        >> > "</script>"
        >> >
        >> > Page.RegisterSt artupScript("Po pupScript", popupScript)
        >> >[/color]
        >>
        >>
        >>[/color][/color]


        Comment

        • klynn

          #5
          Re: RegisterStartup Script &amp; Window.Open

          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

          "Bruce Barker" wrote:
          [color=blue]
          > 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)
          >
          >
          >
          >
          >
          > "klynn" <klynn@discussi ons.microsoft.c om> wrote in message
          > news:021A1B39-0C02-4BB7-AD7E-539B252CFD2A@mi crosoft.com...[color=green]
          > > Any good ideas for workarounds using code? I get the feeling that
          > > RegisterStartup Script 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)
          > >
          > > "Bruce Barker" wrote:
          > >[color=darkred]
          > >> 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)
          > >>
          > >>
          > >>
          > >>
          > >> "klynn" <klynn@discussi ons.microsoft.c om> wrote in message
          > >> news:F39BFE45-1680-437C-9D0E-476109A46856@mi crosoft.com...
          > >> > In my Page_Load I call a RegisterStartup Script. 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='JavaS cript'>"
          > >> > & _
          > >> > "window.open('R tFileResult.asp x', '', " & _
          > >> > "'width=750 , height=580,
          > >> > scrollbars,stat us,menubar,resi zable,toolbar,t itlebar,locatio n');" & _
          > >> > "</script>"
          > >> >
          > >> > Page.RegisterSt artupScript("Po pupScript", popupScript)
          > >> >
          > >>
          > >>
          > >>[/color][/color]
          >
          >
          >[/color]

          Comment

          Working...