Click or drag to resize

NotificationsItemSaving Field

Occurs before the news item has been saved.

Namespace:  Dynamicweb.News
Assembly:  Dynamicweb.News (in Dynamicweb.News.dll) Version: 1.0.10
Syntax
public const string ItemSaving = "DWN_MODULES_NEWSV2_ITEMSAVING"

Field Value

Type: String
Remarks
Examples
Example
[Dynamicweb.Extensibility.Subscribe(Dynamicweb.Notifications.NewsV2.ItemSaving)]
    public class NewsV2ItemSavingObserver : Dynamicweb.Extensibility.NotificationSubscriber
    {
        public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
        {
            if (args == null)
                return;

            if (!(args is Dynamicweb.NewsV2.Extensibility.NewsItemNotificationArgs))
                return;

            Dynamicweb.NewsV2.Extensibility.NewsItemNotificationArgs news = (Dynamicweb.NewsV2.Extensibility.NewsItemNotificationArgs)args;

            news.Item.NewsAuthor = "me";
        }
    }
See Also