Reputation: 13574
I need to have links which will point to other website web pages. Currently I am using the following method.
<a href="@reseller.Url">Product-Page</a>
I was wondering if i can use ActionLink for the same. Or ActionLink is just for in-house action methods ? Do I have other better choices or my above usage is correct for the requirement
Upvotes: 0
Views: 2135
Reputation: 49544
The ActionLink
method is strictly for "Action Methods", which are methods in a controller that return an ActionResult
.
Your above usage is correct.
If you wish to wrap the entire link creation process, you could create your own helper method on the HtmlHelper
class to do this.
This answer shows an example of creating an HTML helper for image links:
Is there an ASP.NET MVC HtmlHelper for image links?
Yours would probably be simpler, if you do choose to write a helper.
Upvotes: 1