Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. Window.Opener equivalent

Window.Opener equivalent

Scheduled Pinned Locked Moved C#
sysadminhelp
6 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Craigpt
    wrote on last edited by
    #1

    Hi All, I have a page that is used in two separate scenarios, either directly linked in the web application, or as a popup using window.open. On this page is a datagrid with three columns i care about, column1 is just some information (a KeyWord) and defaulted to visible=false for when the page is used as a popup, column2 is the same information but used as a link when the window is a popup, and column3 is a select command item also default to visible=false. basically, i want it so that when used as a popup: column1 = visible false column2 = visible true column3 = visible false when linked in the main window: column1 = visible true column2 = visible false column3 = visible true (the exact opposite) I want to be able to check onload the page's status, and change the visibilities accordingly. Changing the visibility is easy enough, but i can't find a way to check whether or not this page is a popup (window.opener != null) or not (window.opener == null) using server side code. Any help would be appreciated

    G E 2 Replies Last reply
    0
    • C Craigpt

      Hi All, I have a page that is used in two separate scenarios, either directly linked in the web application, or as a popup using window.open. On this page is a datagrid with three columns i care about, column1 is just some information (a KeyWord) and defaulted to visible=false for when the page is used as a popup, column2 is the same information but used as a link when the window is a popup, and column3 is a select command item also default to visible=false. basically, i want it so that when used as a popup: column1 = visible false column2 = visible true column3 = visible false when linked in the main window: column1 = visible true column2 = visible false column3 = visible true (the exact opposite) I want to be able to check onload the page's status, and change the visibilities accordingly. Changing the visibility is easy enough, but i can't find a way to check whether or not this page is a popup (window.opener != null) or not (window.opener == null) using server side code. Any help would be appreciated

      G Offline
      G Offline
      Guffa
      wrote on last edited by
      #2

      Craigpt wrote:

      i can't find a way to check whether or not this page is a popup (window.opener != null) or not (window.opener == null) using server side code.

      You can't. The browser doesn't tell the server where the page will be displayed, so the server simply doesn't know. If you put a value in the querystring that reflects how the page is used, the server can check that value.

      --- single minded; short sighted; long gone;

      C 1 Reply Last reply
      0
      • C Craigpt

        Hi All, I have a page that is used in two separate scenarios, either directly linked in the web application, or as a popup using window.open. On this page is a datagrid with three columns i care about, column1 is just some information (a KeyWord) and defaulted to visible=false for when the page is used as a popup, column2 is the same information but used as a link when the window is a popup, and column3 is a select command item also default to visible=false. basically, i want it so that when used as a popup: column1 = visible false column2 = visible true column3 = visible false when linked in the main window: column1 = visible true column2 = visible false column3 = visible true (the exact opposite) I want to be able to check onload the page's status, and change the visibilities accordingly. Changing the visibility is easy enough, but i can't find a way to check whether or not this page is a popup (window.opener != null) or not (window.opener == null) using server side code. Any help would be appreciated

        E Offline
        E Offline
        Ed Poore
        wrote on last edited by
        #3

        Wouldnt' this be more appropriate in the ASP.NET forum?


        My Blog[^]

        C 1 Reply Last reply
        0
        • G Guffa

          Craigpt wrote:

          i can't find a way to check whether or not this page is a popup (window.opener != null) or not (window.opener == null) using server side code.

          You can't. The browser doesn't tell the server where the page will be displayed, so the server simply doesn't know. If you put a value in the querystring that reflects how the page is used, the server can check that value.

          --- single minded; short sighted; long gone;

          C Offline
          C Offline
          Craigpt
          wrote on last edited by
          #4

          Guffa wrote:

          The browser doesn't tell the server where the page will be displayed, so the server simply doesn't know.

          Ok thanks, that's what i needed to know. I remembered the popup window already had querystrings in the URL so i just used the presence of those to decide.

          1 Reply Last reply
          0
          • E Ed Poore

            Wouldnt' this be more appropriate in the ASP.NET forum?


            My Blog[^]

            C Offline
            C Offline
            Craigpt
            wrote on last edited by
            #5

            Ya, it was a toss-up for me, but i decided that in the ASP.net forum i ran the risk of getting a VB.Net answer, and if code was available i wanted it in C#

            E 1 Reply Last reply
            0
            • C Craigpt

              Ya, it was a toss-up for me, but i decided that in the ASP.net forum i ran the risk of getting a VB.Net answer, and if code was available i wanted it in C#

              E Offline
              E Offline
              Ed Poore
              wrote on last edited by
              #6

              There isn't that much difference and both can easily be translated between the other, besides you could always just ask for it to be given in C#.


              My Blog[^]

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • World
              • Users
              • Groups