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 (관리 영역 내부)에서 프론트 페이지 홈 컨트롤러 :

[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

이 작품! 얼마나 어리석은 나를 롤 :-) 고마워! –

+0

당신을 진심으로 환영합니다! –