Pieczarr Pieczarr - 1 year ago 553
ASP.NET (C#) Question

How to open new tab before redirect

In my ASP project I need to open a new tab before redirecting website to a new address.

To open a new tab I use:

Context.Response.Write("<script> language='javascript'>window.open('google.com','_newtab');</script>");

which works like a charm until I add lines for redirect:

Response.Redirect(String.Format("~/CloseRequest.aspx?request_id={0}&returnURL={1}", RequestID, ReturnURL));

If I leave both lines the page will only redirect me to without opening a new tab.

How can I solve this?

Answer Source
    Context.Response.Write("<script language='javascript'>window.open('google.com','_newtab');
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download