Absolute (external) URLs with Html.ActionLink

I'm unable to get Html.ActionLink to produce absolute urls.

Html.ActionLink(DataBinder.Eval(c.DataItem, "Name").ToString(), DataBinder.Eval(c.DataItem, "Path").ToString())

This pulls the data from my model correctly, but appends the path to the end of the current page, producing URLs like "http://localhost:24590/www.google.com"

How can I get this to work how I want it to?

Answers


Use an absolute URL starting with i.e. http://.

<a href="www.google.com"></a>

would have the same result, because it's a relative url.


This works for me:

<a href="http://@Model.URL">
    Click Here
</a>

Need Your Help

JAVA - Spring Integration Flow Transaction + com.atomikos.icatch.HeurHazardException: Heuristic Exception

activemq spring-integration ibm-mq spring-transactions atomikos

i'm trying to make transactional an entire flow of Spring integration, the flow starts with an adapter to an IBM MQ Queue, and then we have a complex flow with ActiveMQ Queues, and i'm getting a com.

get string value from anchor tag, when another anchor tag is clicked

javascript jquery

I have an &lt;ul&gt; that is getting &lt;li&gt;s dynamically added to it while also storing a string in an array. When I click my "delete" image, I need to remove the &lt;li&gt; and the string in the