Asp.net mvc 带有属性路由的动作
我的路线属性如下所示Asp.net mvc 带有属性路由的动作,asp.net-mvc,razor,attributerouting,Asp.net Mvc,Razor,Attributerouting,我的路线属性如下所示 [RouteArea("Settings")] [RoutePrefix("Stores")] public class SettingsMallStoresController : Controller { [HttpGet] [Route("ExistingStores/{Permalink}")] public ActionResult GetExistingStoreBranchesForSelectedHO(strin
[RouteArea("Settings")]
[RoutePrefix("Stores")]
public class SettingsMallStoresController : Controller
{
[HttpGet]
[Route("ExistingStores/{Permalink}")]
public ActionResult GetExistingStoreBranchesForSelectedHO(string permalink)
{
return View("ExistingStoreBranches");
}
}
我正在尝试使用@html.action从视图调用此操作
@Html.Action("Settings/Stores/ExistingStores/{Permalink}",new{permalink=Somevalue})
无论如何都不能让它工作。请帮助我这一个对我有用。仍然不确定如何使用属性路由而不是直接调用控制器操作。更好的方法是可取的
@Html.Action(“GetExistingStoreBranchesForSelectedHO”,新建{Controller=“SettingsMallStores”,Action=“GetExistingStoreBranchesForSelectedHO”})