I am trying open a new window using url.Action. And the new Window url is out of this current project(external website).
Here are two things i need to do:
http://localhost:57391/Home/http:/www.yahoo.com
instead of directly to Yahoo.Here is my code:
<tr >
<td>
<a href="<%= Url.Action("http://www.yahoo.com") %>"><span>Go to Yahoo</span></a>
</td>
</tr>
You don't need to use the helper methods at all:
<a href="http://www.yahoo.com" target="_blank"><span>Go to Yahoo</span></a>
Html.Action
is only for controller actions, which an external link is not. There's nothing wrong with using plain HTML to link with.
You can try doing something like this
<a href="http://@Model.Link" target="_blank"><span>@Model.Link</span></a>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With