asp.net-mvcasp.net-mvc-helpers

MVC @Url.Abs helper does not seem to exist


Just writing a simple mailer using asp mvc mailer I have gone through the tutorial and the email is being send. However i cannot seem to include absolute Urls. In the example they use a Html helper from System.Web.Mvc.UrlHelper

The absolute should be written like so

<a href="@Url.Abs(@Url.Action("Index","Home"))">Linkage</a>

But i get the error

'System.Web.Mvc.UrlHelper' does not contain a definition for 'Abs' and no extension method 'Abs' accepting a first argument of type 'System.Web.Mvc.UrlHelper' could be found (are you missing a using directive or an assembly reference?)

From the searching i have done everyone seems to add it very nonchalant, as if "you just add the thing."

Any suggestions?


Solution

  • You have to add:

    @using Mvc.Mailer;
    

    to your Mailer view