0

我有一個頭版,並具有以下路由的CMS區域:如何從區域路由的默認路由

缺省首頁路線

routes.MapRoute(
    name: "Default", 
    url: "{controller}/{action}/{id}", 
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }, 
    namespaces: new string[] { "SiteFactory.Site.Controllers" } 

給藥途徑

context.MapRoute(
     "Administration_default", 
     "administration/{controller}/{action}/{id}", 
     new { controller = "Home", action = "Index", id = UrlParameter.Optional } 
     ); 

我想從我的ContentController(管理區域內)路由到首頁HomeController,像這樣:

[HttpPost] 
[ValidateInput(false)] 
public ActionResult Save(string content, string contentId, string pageId) 
{ 
    if (ModelState.IsValid) 
    { 
     //TODO: save content. 
    } 
    return RedirectToRoute("Default"); 
} 

我該怎麼做?

回答

1

只是return RidirectToAction("Index", "Home");

+0

This Works!多麼愚蠢的我大聲笑:-)謝謝! –

+0

不客氣! –