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. Web Development
  3. ASP.NET
  4. Passing value to a popup window???

Passing value to a popup window???

Scheduled Pinned Locked Moved ASP.NET
toolsquestion
3 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.
  • H Offline
    H Offline
    hounetdev
    wrote on last edited by
    #1

    Ok, I am Poping up a window, but i want to pass it a value from the opener window. How would i go about doing that? Here is how i am opening the new window. Dim myScript As String = "window.open('datafilter.aspx') </" + "script>" Sub button1_Click(sender As Object, e As EventArgs) Page.RegisterStartupScript("OpenWindowScript", myScript) end sub Thank you, Santana </x-turndown>

    J A 2 Replies Last reply
    0
    • H hounetdev

      Ok, I am Poping up a window, but i want to pass it a value from the opener window. How would i go about doing that? Here is how i am opening the new window. Dim myScript As String = "window.open('datafilter.aspx') </" + "script>" Sub button1_Click(sender As Object, e As EventArgs) Page.RegisterStartupScript("OpenWindowScript", myScript) end sub Thank you, Santana </x-turndown>

      J Offline
      J Offline
      Jesse Squire
      wrote on last edited by
      #2

      The simplest way that comes to mind would be to use a query string for the window URL. For example:

      string script = "<script language=\"javascript\">window.open('datafilter.aspx**?param1=blue&param2=green**')";

      [Bold and italics added to querystring for emphasis.] If the parameters are unknown at rendering time, you can simply modify the client script to use a variable for the query string, and add a client side handler to populate that variable. Of course, this isn't secure... so if the parameters are sensitive in nature, I wouldn't recommend this approach. The more complex way that occurs to me is to manipulate the new window using the handle that javascript returns when you open it. If you choose to go that route, try googling for "javascript and new window". There are numerious examples explained far better then I could. Hope that helps a bit. :)   --Jesse

      1 Reply Last reply
      0
      • H hounetdev

        Ok, I am Poping up a window, but i want to pass it a value from the opener window. How would i go about doing that? Here is how i am opening the new window. Dim myScript As String = "window.open('datafilter.aspx') </" + "script>" Sub button1_Click(sender As Object, e As EventArgs) Page.RegisterStartupScript("OpenWindowScript", myScript) end sub Thank you, Santana </x-turndown>

        A Offline
        A Offline
        Albert Pascual
        wrote on last edited by
        #3

        Dim myScript As String = "window.open('datafilter.aspx<pre>?Parameter=MyParameter')</pre> </code> You can pass them as a normal page. </x-turndown>

        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