-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathQuickNavigatorInitializer.cs
More file actions
25 lines (21 loc) · 907 Bytes
/
QuickNavigatorInitializer.cs
File metadata and controls
25 lines (21 loc) · 907 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using EPiServer.Framework;
using EPiServer.Framework.Initialization;
using System.Web.Routing;
namespace Gosso.EPiServerAddOn.QuickNavExtension
{
[InitializableModule]
public class QuickNavigatorInitializer : IInitializableModule
{
private const string RouteName = "LogoutRedirect";
public void Initialize(InitializationEngine context)
{
//important to override with a "key" (that can be anything), not to cause it to be a default route and the MVC will use default when used with @Ajax.ActionLink and sometimes xforms action url
RouteTable.Routes.Add(RouteName, new Route("logout/{key}", new RedirectRouteHandler()));
}
public void Preload(string[] parameters) { }
public void Uninitialize(InitializationEngine context)
{
RouteTable.Routes.Remove(RouteTable.Routes[RouteName]);
}
}
}