You'll need to create a custom route otherwise Umbraco will intercept the request. Try adding this to your solution:
using System;
using System.Configuration;
using System.Web.Routing;
using Umbraco.Web;
using Umbraco.Web.Mvc;
namespace MyNamespace
{
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.MapUmbracoRoute(
"logOut",
"LogOut",
new
{
controller = "Membership",
action = "MvcMemberLogout"
},
new UmbracoVirtualNodeByIdRouteHandler(1050); // set this to an actual node ID e.g. your homepage
}
}
}
Then you should be able to hit /logout.
Remember to call RouteConfig.RegisterRoutes:
public class Startup : ApplicationEventHandler
{
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
{
base.ApplicationStarted(umbracoApplication, applicationContext);
RouteConfig.RegisterRoutes(RouteTable.Routes);
}
}
Log out acton is not working
Hi ,
I am trying to implement logout, below is the code:
calling from :
however is not working. any idea about this?
You'll need to create a custom route otherwise Umbraco will intercept the request. Try adding this to your solution:
Then you should be able to hit /logout.
Remember to call RouteConfig.RegisterRoutes:
There's documentation on custom routes here:
https://our.umbraco.org/documentation/reference/routing/custom-routes
thanks a lot gfyans :)
is working on a reply...