Dynamicweb 8 Documentation
Saved Field (Standard.Paragraph)
Example 

Paragraph saved notification. Occurs after the paragraph has been saved.
Syntax
'Declaration
 
Public Const Saved As String
public const string Saved
Example
Overriding paragraph saved in DynamicwebOverriding paragraph saved in Dynamicweb
namespace Dynamicweb.Examples.CSharp.Notifications.Standard
{
    [Extensibility.Subscribe(Dynamicweb.Notifications.Standard.Paragraph.Saved)]
    public class ParagraphSavedObserver : Dynamicweb.Extensibility.NotificationSubscriber
    {
        public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
        {
            if (args == null)
                return;

            Dynamicweb.Notifications.Standard.Paragraph.ParagraphNotificationArgs item = (Dynamicweb.Notifications.Standard.Paragraph.ParagraphNotificationArgs)args;

            //Pass paragraph Id and text to save to the notification e-mail
            string emailBody = string.Format("The paragraph (ID:{0}) has been saved.<hr/><fieldset>{1}</fieldset>", item.Target.ID, item.Target.Text);
            Dynamicweb.Modules.Common.Email.SendMail("user name", "user@somedomain.dk", "ParagraphSavedObserver",
                "admin", "noreply@dynamicweb.dk", emailBody, "UTF-8");
        }
    }
}
Namespace Notifications.Standard
    <Extensibility.Subscribe(Global.Dynamicweb.Notifications.Standard.Paragraph.Saved)> _
    Public Class ParagraphSavedObserver
        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 item As Global.Dynamicweb.Notifications.Standard.Paragraph.ParagraphNotificationArgs = DirectCast(args, Global.Dynamicweb.Notifications.Standard.Paragraph.ParagraphNotificationArgs)

            'Pass paragraph Id and text to save to the notification e-mail
            Dim emailBody As String = String.Format("The paragraph (ID:{0}) has been saved.&lt;hr/&gt;&lt;fieldset&gt;{1}&lt;/fieldset&gt;", item.Target.ID, item.Target.Text)
            Global.Dynamicweb.Modules.Common.Email.SendMail("user name", "user@somedomain.dk", "ParagraphSavedObserver", "admin", "noreply@dynamicweb.dk", emailBody, "UTF-8")
        End Sub
    End Class
End Namespace
Remarks
The passed NotificationArgs is Dynamicweb.Notifications.Standard.Paragraph.ParagraphNotificationArgs
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.Paragraph Class
Standard.Paragraph Members

Send Feedback