Click here to Skip to main content
15,896,475 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
C#
string v1 = "nitin";
        string javaScript = "window.open('Default2.aspx?p1='" + v1 +",'','width=400, height=400, left=300, top=400');";
        ScriptManager.RegisterStartupScript(this, this.GetType(), "hi", javaScript.ToString(), true);




if i m not passing the parameter it work fine but it doesn't work with parameter
Posted
Comments
krumia 23-Feb-12 6:00am    
FYI: You don't need to call ToString() on an object which is already a string.

try this:-
string v1 = "nitin";
        string javaScript = "window.open('Default2.aspx?p1=" & v1 & "','newwindow','width=400, height=400, left=300, top=400');return false;";
        ScriptManager.RegisterStartupScript(this, this.GetType(), "hi", javaScript, true);
 
Share this answer
 
Hi
try this
C#
string v1 = "nitin";
           string jscript = "window.open('Default2.aspx?p1=" + v1 + "','','width=400, height=400, left=300, top=400');";
           ScriptManager.RegisterStartupScript(this, this.GetType(), "hi", jscript.ToString(), true);
 
Share this answer
 

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