2012-07-18 64 views
1

在视图中使用asp.net mvc。 如何在新标签中重定向到外部网页?如何在新标签中重定向到外部网页?

<%= Html.ActionLink("Paypal", "HowItWorksRedirect", null, new { @class = "Paypal" })%> 

public ActionResult HowItWorksRedirect() 
     { 
      return Redirect("https://www.paypal-deutschland.de/sicherheit/schutzprogramme.html"); 
     } 

回答

2

您不会将此传递给控制器​​操作,因为您没有链接到您自己的网站中。只需手动编写标记。如果您需要重新使用它,请将其放在一个部分或部分视图中:

<a href="https://www.paypal-deutschland.de/sicherheit/schutzprogramme.html" target="_blank" class="Paypal">Paypal</a>