Passing parameters to Javascript popup window
-
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
-
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
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));
-
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));
-
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?
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));
-
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));
-
I used this statement to pass values var param1 = document.getElementById('textBox1').value; but it dost not passing anything i am getting null value.
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));