1

I have the following template which redirects the user which works fine, how can I get it so it opens up in a new window?

@{
    Layout = "Master.cshtml";

    var links = Model.Value<IEnumerable<Link>>("linkTarget");

    if (links != null && links.Any())
    {
        var prettyLink = links.FirstOrDefault();
        Context.Response.Redirect(prettyLink.Url,true);
    }
}

Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
Matt
  • 25
  • 1
  • 3
  • 1
    See the answer [here](https://stackoverflow.com/questions/104601/response-redirect-to-new-window). This might help. – Peter Smith Mar 17 '23 at 09:29

1 Answers1

1

Try following codes;

response.write("<script>");response.write("window.open('index.html','_blank')");response.write("</script>");