By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,317 Members | 1,329 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,317 IT Pros & Developers. It's quick & easy.

Passing parameters to Javascript Popup window

P: 53
Hi,

I have written the code for display popup window using javascript in button onclient click event.
Expand|Select|Wrap|Line Numbers
  1.    <asp:Button ID="Button1" runat="server" Style="position: static" OnClientClick="openwindow()"
  2.                 Text="Execute"/>
  3. <script type="text/javascript">
  4. function openwindow()
  5. {
  6. window.open("AssignedTickets.aspx",'window','width=630,height=620,background=silver,menubar=no, resizable=no')
  7. }
  8. </script>
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 to pass parameters to popup window using javascript.


Thanks in Advance
Pavani
Feb 24 '09 #1
Share this Question
Share on Google+
3 Replies


acoder
Expert Mod 15k+
P: 16,027
It could be as simple as:
Expand|Select|Wrap|Line Numbers
  1. window.open("AssignedTickets.aspx?par=val&par2=val2",...
PS. please remember to use [code] tags when posting code.
Feb 24 '09 #2

P: 53
I used this statement to pass values
var param1 = document.getElementById('textBox1').value;
but it dost not passing anything i am getting null value.
Can you tell me the exact syntax to pass values?
Feb 24 '09 #3

acoder
Expert Mod 15k+
P: 16,027
Ah, in that case, you would use:
Expand|Select|Wrap|Line Numbers
  1. window.open("AssignedTickets.aspx?param1="+param1,...
To avoid possible problems with special characters, you may want to wrap 'param1' with encodeURIComponent().
Feb 24 '09 #4

Post your reply

Sign in to post your reply or Sign up for a free account.