Dynamicweb 8 Documentation
OnBeforeComment Field
Example 

On before comment notification. Occurs on submit of new comments - before the data is saved
Syntax
'Declaration
 
Public Const OnBeforeComment As String
public const string OnBeforeComment
Example
Overriding the before comment submit in DynamicwebOverriding the before comment submit in Dynamicweb
namespace Dynamicweb.Examples.CSharp.Notifications
{
    [Extensibility.Subscribe(Dynamicweb.Notifications.Commenting.OnBeforeComment)]
    public class OnBeforeCommentObserver : Dynamicweb.Extensibility.NotificationSubscriber
    {
        public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
        {
            Dynamicweb.Notifications.Commenting.CommentArgs commentArgs = args as Dynamicweb.Notifications.Commenting.CommentArgs;

            //TODO: Add code here
        }
    }
}

Namespace Notifications.Commenting
    <Extensibility.Subscribe(Global.Dynamicweb.Notifications.Commenting.OnBeforeComment)> _
    Public Class OnBeforeCommentObserver
        Inherits Global.Dynamicweb.Extensibility.NotificationSubscriber

        Public Overrides Sub OnNotify(ByVal notification As String, ByVal args As Global.Dynamicweb.Extensibility.NotificationArgs)
            Dim commentArgs As Global.Dynamicweb.Notifications.Commenting.CommentArgs = TryCast(args, Global.Dynamicweb.Notifications.Commenting.CommentArgs)
            If commentArgs IsNot Nothing Then
                'TODO: Add code here
            End If
        End Sub

    End Class
End Namespace
Remarks
The passed NotificationArgs is Dynamicweb.Notifications.Commenting.CommentArgs
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

Commenting Class
Commenting Members

Send Feedback