The error itself exposes the solution. You need to stop using:
return new UrlHelper(helper.ViewContext).DisplayLink(action, linkText, returnLink);
And instead use (notice I'm not using DI, but you should use DI to retrieve IUrlHelperFactory):
var urlHelperFactory = ServiceLocator.Current.GetInstance<IUrlHelperFactory>();
return urlHelperFactory.GetUrlHelper(helper.ViewContext).DisplayLink(action, linkText, returnLink);
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment