Dynamicweb.Notifications Namespace > Standard.Page Class : NotFound Field |
namespace Dynamicweb.Examples.CSharp.Notifications.Standard { [Extensibility.Subscribe(Dynamicweb.Notifications.Standard.Page.NotFound)] public class PageNotFoundObserver : Dynamicweb.Extensibility.NotificationSubscriber { public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args) { if (args == null) return; Dynamicweb.Notifications.Standard.Page.NotFoundArgs notFoundArgs = (Dynamicweb.Notifications.Standard.Page.NotFoundArgs)args; // Getting the absolute path of the page string url = notFoundArgs.Url; } } }
Namespace Notifications.Standard <Extensibility.Subscribe(Global.Dynamicweb.Notifications.Standard.Page.NotFound)> _ Public Class PageNotFoundObserver Inherits Global.Dynamicweb.Extensibility.NotificationSubscriber Public Overrides Sub OnNotify(ByVal notification As String, ByVal args As Global.Dynamicweb.Extensibility.NotificationArgs) If args Is Nothing Then Return End If Dim notFoundArgs As Global.Dynamicweb.Notifications.Standard.Page.NotFoundArgs = DirectCast(args, Global.Dynamicweb.Notifications.Standard.Page.NotFoundArgs) ' Getting the absolute path of the page Dim url As String = notFoundArgs.Url End Sub End Class End Namespace
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2