Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generic Action Link in MVC 3 / Razor

Just started a new MVC 3 project and I can't get the strongly-type generic action link and url helpers I am used to in MVC 2 futures.

Which nuget packages and namespaces do I need to get hold off?

Example

Html.ActionLink<HomeController>(c => c.Index(), "Home")

ANSWER:

Just needed to reference Microsoft.Web.Mvc via NuGet MvcContrib - and make the namespace available in the views.

like image 332
nick Avatar asked May 17 '11 09:05

nick


3 Answers

Which nuget packages and namespaces do I need to get hold off?

  • Official NuGet Mvc3Futures package is here
  • Namespace to declare is Microsoft.Web.Mvc
like image 166
nulltoken Avatar answered Nov 08 '22 20:11

nulltoken


Grab the T4MVC package in NuGet.

like image 32
Jan Jongboom Avatar answered Nov 08 '22 21:11

Jan Jongboom


Just need to reference Microsoft.Web.Mvc

like image 1
nick Avatar answered Nov 08 '22 19:11

nick