I trying to get my link to open in a new tab (it must be in razor format):
<a href="@Url.Action("RunReport", "Performance", new { reportView = Model.ReportView.ToString() }, new { target = "_blank" })" type="submit" id="runReport" class="button Secondary">@Reports.RunReport</a>
This is not working though. Anyone know how to do this?
<a href="@Url.Action("RunReport", "Performance", new { reportView = Model.ReportView.ToString() })" type="submit" id="runReport" target="_blank" class="button Secondary"> @Reports.RunReport </a>
If your goal is to use the ActionLink helper and open a new tab:
With Named arguments:
You are setting it't
type
assubmit
. That means that browser should post your<form>
data to the server.In fact a tag has no type attribute according to w3schools.
So remote
type
attribute and it should work for you.