Dynamicweb 8 Documentation
Standard.Page.PageNotificationArgs Class
Members  Example 

Provides information about the single page.
Object Model
Standard.Page.PageNotificationArgs ClassPage Class
Syntax
'Declaration
 
Public Class Standard.Page.PageNotificationArgs 
   Inherits Dynamicweb.Extensibility.NotificationArgs
public class Standard.Page.PageNotificationArgs : Dynamicweb.Extensibility.NotificationArgs 
Remarks
Arguments passed to Dynamicweb.Notifications.Standard.Page.Saved notification, Dynamicweb.Notifications.Standard.Page.Deleted notification, Dynamicweb.Notifications.Standard.Page.PublishedStateChanged notification, Dynamicweb.Notifications.Standard.Page.ActiveStateChanged notification, Dynamicweb.Notifications.Standard.Page.Optimized notification
Example
Using PageNotificationArgs in the page saved notification of DynamicwebUsing PageNotificationArgs in the page saved notification of Dynamicweb
namespace Dynamicweb.Examples.CSharp.Notifications.Standard
{
    [Extensibility.Subscribe(Dynamicweb.Notifications.Standard.Page.Saved)]
    public class PageSavedObserver : Dynamicweb.Extensibility.NotificationSubscriber
    {
        public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
        {
            if (args == null)            
                return;

            Dynamicweb.Notifications.Standard.Page.PageNotificationArgs pna = (Dynamicweb.Notifications.Standard.Page.PageNotificationArgs)args;
            //Pass page Id to the notification e-mail
            string emailBody = string.Format("The page (ID:{0}) has been saved.", pna.Target.ID);
            Dynamicweb.Modules.Common.Email.SendMail("user name", "usermail@somedomain.com", "PageSavedObserver",
                "admin", "noreply@dynamicweb.dk", emailBody, "UTF-8");
        }
    }
}
Namespace Notifications.Standard
    <Extensibility.Subscribe(Global.Dynamicweb.Notifications.Standard.Page.Saved)> _
    Public Class PageSavedObserver
        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 pna As Global.Dynamicweb.Notifications.Standard.Page.PageNotificationArgs = DirectCast(args, Global.Dynamicweb.Notifications.Standard.Page.PageNotificationArgs)
            'Pass page Id to the notification e-mail
            Dim emailBody As String = String.Format("The page (ID:{0}) has been saved.", pna.Target.ID)
            Global.Dynamicweb.Modules.Common.Email.SendMail("user name", "usermail@somedomain.com", "PageSavedObserver", "admin", "noreply@dynamicweb.dk", emailBody, "UTF-8")
        End Sub
    End Class
End Namespace
Inheritance Hierarchy

System.Object
   Dynamicweb.Extensibility.NotificationArgs
      Dynamicweb.Notifications.Standard.Page.PageNotificationArgs

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.PageNotificationArgs Members
Dynamicweb.Notifications Namespace

Send Feedback