Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to open page in new tab using the response. redirect at asp.net

Tags:

I want to open a new tab or a new page by using Response.Redirect in a button click handler. I'm using a query string to pass some values. How can I open he page in a new tab?

protected void btnSave_Click(object sender, EventArgs e) {     ...//some code to insert records     Response.Redirect("NewQuote.aspx?val=" + this.txtQuotationNo.Text);//displaying gridview in other page to print what needed } 
like image 335
krishna mohan Avatar asked Dec 29 '15 11:12

krishna mohan


People also ask

How do I redirect a new tab to another page?

Use the method window. open(url, target) to open a new window (it depends on the browser or the user's settings whether the URL is opened in a new window or tab): window. open('http://stackoverflow.com', '_blank');

How do I use response redirect?

Response. Redirect sends an HTTP request to the browser, then the browser sends that request to the web server, then the web server delivers a response to the web browser. For example, suppose you are on the web page "UserRegister. aspx" page and it has a button that redirects you to the "UserDetail.

How do I open a new tab in VB net?

You just need to use the '_blank' without 'left=100,top=100,resizable=yes' if you want it to open in new tab.


1 Answers

Try this. This works sure for me...

protected void btnSave_Click(object sender, EventArgs e) {     ...//some code to insert records     Response.Write("<script>window.open ('NewQuote.aspx?val=" + txtQuotationNo.Text+"','_blank');</script>"); } 
like image 50
Chetan Kumar Avatar answered Oct 26 '22 03:10

Chetan Kumar