0
A
回答
2
1
If you are using Form Authentication , try
// Inside Controller
public ActionResult LogOff()
{
FormsAuthentication.SignOut();
return RedirectToAction("Index", "Home");
}
// Inside View (Layout Page) Razor Engine
@if(User.Identity.IsAuthenticated){
@Html.ActionLink("Your text goes here.", "LogOff", "YourControllerName")
}
+0
太棒了。謝謝!! – Subby
相關問題
- 1. ASP MVC 3註銷
- 2. 當用戶註銷ASP.net MVC
- 3. 註銷asp.net MVC後User.Identity.IsAuthenticated真
- 4. ASP.Net MVC 4 OAuthWebSecurity註銷
- 5. Asp.net mvc 3依賴注入
- 6. ASP.net MVC 3用戶註冊
- 7. ASP.NET MVC 3 RemoteAttribute和關注
- 8. ASP.NET MVC路由登錄/註銷問題
- 9. 註銷指定的用戶asp.net mvc
- 10. 從MVC註銷
- 11. 註銷在asp.net
- 12. 註銷在笨3
- 13. 註銷asp.net不完整
- 14. ASP MVC 3基本註冊/登錄/註銷在不同的表
- 15. ASP.Net Identity從SQL註銷
- 16. asp.net會話註銷
- 17. Asp.net MVC 3注入UserControl for TemplateHint
- 18. ASP.NET MVC 3個標註不顯示
- 19. ASP.Net MVC 3 ViewModel數據註釋
- 20. ASP.NET MVC中的Ninject注入問題3
- 21. 如何在註銷時清除MVC 3路由參數
- 22. ASP.NET ScriptControl&ASP.NET MVC 3
- 23. MVC中的註銷操作
- 24. 與ASP.NET MVC 3
- 25. ASP.Net MVC 3 ModelState.IsValid
- 26. ASP.NET MVC 3 DropDownListFor
- 27. ASP.NET MVC 3:EF
- 28. ASP.NET MVC 3 Ajax.ActionLink
- 29. ASP.NET MVC 3 AuthorizeAttribute
- 30. ASP.Net MVC 3&System.Data.Entity?
你是如何處理的認證/會員? – jrummell