本文介绍了更正代码的语法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
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
推荐答案尝试以下操作:- 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);
您好 试试这个 Hi try this 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);
更多推荐
更正代码的语法
发布评论