2010-05-11 78 views
1

我有一個自定義的登錄actionfilter,我試圖「升級」到mvc 2使用區域。以編程方式從區域+控制器+動作獲取url

private void RedirectToRoute(ActionExecutingContext context, object routeValues) 
    { 
     var rc = new RequestContext(context.HttpContext, context.RouteData); 

     string url = RouteTable.Routes.GetVirtualPath(rc, 
      new RouteValueDictionary(routeValues)).VirtualPath; 

     context.HttpContext.Response.Redirect(url, true); 
    } 

是如何在我的MVC 1.0項目看這,我嘗試調用它現在這個樣子:

RedirectToRoute(filterContext, 
        new 
        { 
         controller = Controller, 
         action = Action, 
         area = Area 
        }); 

什麼需要添加,使其重定向到藏漢適當的區域?

/M

回答

0

解決的問題......我有2個區域,並匹配在第二的人,後者一個圖路線

相關問題