Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Am trying to pass the parameter using javascript
see ma code

node.navigateurl = "javascript: window.open('" + urlofthepage+ "',width=200,height=100);pname=" + trackid;

now in that page which am opening using above code, i have written the below code
C#
if (Page.Request.QueryString["pname"] != null)
          {
              string querystring = Page.Request.QueryString.Get("pname").ToString();
          }


But it is always returning null. Am passing value from there but unable to fetch it using QueryString.

What could be the reason?
Posted
Comments
bbirajdar 28-Feb-14 2:16am    
Use ?pname instaed of ;pname
Ramug10 28-Feb-14 2:21am    
show me your javascript code..code you show is not in correct just show your exact code.
Am Gayathri 28-Feb-14 2:26am    
treebasiclinkchild.NavigateUrl = "javascript: window.open('" + urlofpage+ "',width=200,height=100);pname=" + proid;
Am Gayathri 28-Feb-14 2:24am    
Not working :(
Ramug10 28-Feb-14 2:31am    
Please refer this helpful to you

function Test() {
var value1 = 100;
var value2 = 200;
var value3 = 300;
window.open('<%=Url.Action("Index?param1=") %> ' + value1 + '¶m2=' + value2 + '¶m3=' + value3, "", "dialogWidth:875px;dialogHeight:600px");
}

1 solution

Not surprised.
Try:
C#
node.navigateurl = "javascript: window.open('" + urlofthepage+ "?pname=" + trackid + "',width=200,height=100)";
 
Share this answer
 
Comments
Am Gayathri 28-Feb-14 2:52am    
It works :)
Thanks

How can i pass more than one parameter ?
OriginalGriff 28-Feb-14 3:05am    
Add more:
A querysting is:
myDomain.com/pagename?firstparam=value&secondparam=value&thirdparam=value
So just add them to the url after teh '?' and separated by '&' characters.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900