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 parameters to Javascript popup window

Passing parameters to Javascript popup window

Scheduled Pinned Locked Moved ASP.NET
javascripthelp
6 Posts 2 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.
  • P Offline
    P Offline
    pavanip
    wrote on last edited by
    #1

    Hi, I have written the code for display popup window using javascript in button onclient click event. Text="Execute"/> function openwindow() { window.open("AssignedTickets.aspx",'window','width=630,height=620,background=silver,menubar=no, resizable=no') } And I want to pass parameters to that popup page because there are some search parameters i need to pass those to popup page and display the results in popup page. Please anybody help me how pass parameters using javascript. Thanks in Advance Pavani

    G 1 Reply Last reply
    0
    • P pavanip

      Hi, I have written the code for display popup window using javascript in button onclient click event. Text="Execute"/> function openwindow() { window.open("AssignedTickets.aspx",'window','width=630,height=620,background=silver,menubar=no, resizable=no') } And I want to pass parameters to that popup page because there are some search parameters i need to pass those to popup page and display the results in popup page. Please anybody help me how pass parameters using javascript. Thanks in Advance Pavani

      G Offline
      G Offline
      Greg Chelstowski
      wrote on last edited by
      #2

      pavanip wrote:

      function openwindow() { window.open("AssignedTickets.aspx",'window','width=630,height=620,background=silver,menubar=no, resizable=no') }

      Adding parameters to the querystring would be a clean way of doing it, though it has its disadvantages. Do:

      function openwindow()
      {
      window.open("AssignedTickets.aspx?Param1=Something¶m2=somethingother",'window','width=630,height=620,background=silver,menubar=no, resizable=no')
      }

      Then in the code behind of AssignedTickets you can access these with:

      string param1 = Request.QueryString["param1"];

      var question = (_2b || !(_2b));

      P 1 Reply Last reply
      0
      • G Greg Chelstowski

        pavanip wrote:

        function openwindow() { window.open("AssignedTickets.aspx",'window','width=630,height=620,background=silver,menubar=no, resizable=no') }

        Adding parameters to the querystring would be a clean way of doing it, though it has its disadvantages. Do:

        function openwindow()
        {
        window.open("AssignedTickets.aspx?Param1=Something¶m2=somethingother",'window','width=630,height=620,background=silver,menubar=no, resizable=no')
        }

        Then in the code behind of AssignedTickets you can access these with:

        string param1 = Request.QueryString["param1"];

        var question = (_2b || !(_2b));

        P Offline
        P Offline
        pavanip
        wrote on last edited by
        #3

        thanks for your response. I am trying with that code. But my values are in textboxes. can you tll me exact syntax to assign textbox values to param1 ans param2?

        G 1 Reply Last reply
        0
        • P pavanip

          thanks for your response. I am trying with that code. But my values are in textboxes. can you tll me exact syntax to assign textbox values to param1 ans param2?

          G Offline
          G Offline
          Greg Chelstowski
          wrote on last edited by
          #4

          Oh, man...

          var param1 = document.getElementById('textBox1').value;

          obviously it doesnt have to be called param1. Please read up on javascript, seems like you need it. Good luck.

          var question = (_2b || !(_2b));

          P 1 Reply Last reply
          0
          • G Greg Chelstowski

            Oh, man...

            var param1 = document.getElementById('textBox1').value;

            obviously it doesnt have to be called param1. Please read up on javascript, seems like you need it. Good luck.

            var question = (_2b || !(_2b));

            P Offline
            P Offline
            pavanip
            wrote on last edited by
            #5

            I used this statement to pass values var param1 = document.getElementById('textBox1').value; but it dost not passing anything i am getting null value.

            G 1 Reply Last reply
            0
            • P pavanip

              I used this statement to pass values var param1 = document.getElementById('textBox1').value; but it dost not passing anything i am getting null value.

              G Offline
              G Offline
              Greg Chelstowski
              wrote on last edited by
              #6

              Oh, come on. it's not my fault your control does not have any text in it. Where are you declaring the param1 variable, anyway? Where are you accessing it from? Is your control's ID textBox1 ? Either put some more code out here or google for it and figure it out yourself. I really do recommend the latter, too.

              var question = (_2b || !(_2b));

              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