Dynamicweb 8 Documentation
OnBeforeRender Field (Standard.Paragraph)
Example 

Paragraph before render notification. Occurs before the paragraph will be rendered.
Syntax
'Declaration
 
Public Const OnBeforeRender As String
public const string OnBeforeRender
Example
Overriding on before render the paragraph in DynamicwebOverriding on before render the paragraph in Dynamicweb
namespace Dynamicweb.Examples.CSharp.Notifications.Standard
{
    [Extensibility.Subscribe(Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRender)]
    public class ParagraphOnBeforeRenderObserver : Dynamicweb.Extensibility.NotificationSubscriber
    {
        public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
        {
            if (args == null)
                return;

            Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRenderArgs item = (Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRenderArgs)args;
            //Change paragrpah template html
            item.ParagraphTemplate.Html = string.Format("Paragraph ID:{0}<fieldset>{1}</fieldset>", item.Paragraph.Paragraph.ParagraphID, item.ParagraphTemplate.Html);
        }
    }
}

Namespace Notifications.Standard
    <Extensibility.Subscribe(Global.Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRender)> _
    Public Class ParagraphOnBeforeRenderObserver
        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.OnBeforeRenderArgs = DirectCast(args, Global.Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRenderArgs)
            'Change paragrpah template html
            item.ParagraphTemplate.Html = String.Format("Paragraph ID:{0}&lt;fieldset&gt;{1}&lt;/fieldset&gt;", item.Paragraph.Paragraph.ParagraphID, item.ParagraphTemplate.Html)
        End Sub
    End Class
End Namespace
Remarks
The passed NotificationArgs is Dynamicweb.Notifications.Standard.Paragraph.OnBeforeRenderArgs
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