Dynamicweb 8 Documentation
NotFound Field
Example 

Page not found notification. Occurs when the 404 handler is about to process the request.
Syntax
'Declaration
 
Public Const NotFound As String
public const string NotFound
Example
Overriding the page loading in DynamicwebOverriding the page loading in Dynamicweb
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
Remarks
The passed NotificationArgs is Dynamicweb.Notifications.Standard.Page.NotFoundEventArgs
Requirements

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

See Also

Reference

Standard.Page Class
Standard.Page Members

Send Feedback