in my asp.net mvc project I want an Action Redirect to a url but I want the page to open in new window.
public ActionResult Index(int id)
{
...
return Redirect(page.Url);
}
You should specify that the link will open in a new window using the target attribute on <a> element in the view i.e.
<a href="@Url.Action("Index", "Controller", new{ area = "", id = 1 })"
target= "_blank">Link text</a>
In the server side you can retrun json (after an ajax call usually)
public ActionResult PreviewReport(Report rep)
{
return Json(new { type = "info", url = "..." }, JsonRequestBehavior.AllowGet);
}
In the client side you execute javascript (the result is from an ajax call to above action)
function (result) {
if (result.type === 'info') {
window.open(result.url, '_blank');
}
}