且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在新选项卡中打开剃刀操作链接?

更新时间:2021-09-23 07:16:22

看起来你很困惑 Html.ActionLink() 用于 Url.Action().Url.Action 没有设置 Target 的参数,因为它只返回一个 URL.

Looks like you are confusing Html.ActionLink() for Url.Action(). Url.Action has no parameters to set the Target, because it only returns a URL.

根据您当前的代码,锚点应该看起来像:

Based on your current code, the anchor should probably look like:

<a href="@Url.Action("RunReport", "Performance", new { reportView = Model.ReportView.ToString() })" 
   type="submit" 
   id="runReport" 
   target="_blank"
   class="button Secondary">
     @Reports.RunReport
</a>