How to pass Area in Url.Action?

You can use this Url.Action(“actionName”, “controllerName”, new { Area = “areaName” }); Also don’t forget to add the namespace of the controller to avoid a conflict between the admin area controller names and the site controller names. Something like this public override void RegisterArea(AreaRegistrationContext context) { context.MapRoute( “Admin_default”, “Admin/{controller}/{action}/{id}”, new { action = “Index”, id … Read more

Url.Action parameters?

The following is the correct overload (in your example you are missing a closing } to the routeValues anonymous object so your code will throw an exception): <a href=”https://stackoverflow.com/questions/6278694/<%: Url.Action(“GetByList”, “Listing”, new { name = “John”, contact = “calgary, vancouver” }) %>”> <span>People</span> </a> Assuming you are using the default routes this should generate the … Read more