krishna mohan
krishna mohan

Reputation: 921

how to open page in new tab with response.redirect or response.write

I have a button event. At the end of the event I am redirecting to another page. But unable to open in new tab.

Giving compilation error -

newline in constant

//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>");

Upvotes: 2

Views: 12507

Answers (1)

Dgan
Dgan

Reputation: 10275

try this:

missing +"

 Response.Write("<script type='text/javascript'>");
 Response.Write("window.open('DeliveryChallanPrint1.aspx?val="+this.txtPoNo.Text+"','_blank');"); 
 Response.Write("</script>");

Upvotes: 5

Related Questions