2015-07-10 26 views
1

顯然,這是行不通的:如何使用指向新Area的RedirectToAction方法添加查詢字符串值?

Session.Clear(); 
FormsAuthentication.SignOut(); 
return RedirectToAction("Login", "Account", new { area = "" }, new { timeout = "true" }); 

我要殺死會話,然後重定向他們回到登錄頁面。我嘗試使用ViewBag,但由於會話被殺,它似乎並沒有工作。

目的是通知客戶會話超時。任何幫助將不勝感激。 :)

回答

1

嘗試

return RedirectToAction("Login", "Account", new { area = "", timeout = "true" }); 

對我的作品好。

+0

完美!謝謝! –

0
return RedirectToAction("Login", new RouteValueDictionary( 
    new { controller = controllerName, action = "Account", Id = Id })); 

類似的東西應該工作,如果你想設置參數。

相關問題