Reputation: 2788
i need to generate a link based on a controller and action but with no anchor tags, ie just generate something like this
http://www.stackoverflow.com/myfavorite/website
Upvotes: 1
Views: 341
Reputation: 1460
Simply, you can write your own helper:
Html.Action(string action, string controller)
and customize result URL via String.Format()
Upvotes: -1
Reputation: 13621
You can use Url.Action rather than Html.ActionLink
Example
<%= Url.Action(new { controller = "myfavourite", action = "website" }) %>
Will give you the 'myfavorite/website' part, which you can prepend with your hostname if required.
Upvotes: 3