我有一个按钮事件。在活动结束时,我将重定向到另一个页面。但无法在新标签中打开。
给出编译错误 -
常量中的换行符
//Response.Redirect("DeliveryChallanPrint1.aspx?val=" +this.txtPoNo.Text);
Response.Write("<script>");
Response.Write("window.open('DeliveryChallanPrint1.aspx?val="+this.txtPoNo.Text','_blank')");//error - newline in constant
Response.Write("</script>");
答案 0 :(得分:3)
试试这个:
缺少+"
Response.Write("<script type='text/javascript'>");
Response.Write("window.open('DeliveryChallanPrint1.aspx?val="+this.txtPoNo.Text+"','_blank');");
Response.Write("</script>");