public override void OnActionExecuted(System.Web.Mvc.ActionExecutedContext filterContext) { ViewResult result = filterContext.Result as ViewResult; if (result != null) { if (result.Model is WidgetBase) { WidgetBase widget = result.Model as WidgetBase; var zoneService = ServiceLocator.Current.GetInstance <IZoneService>(); if (!widget.PageID.IsNullOrEmpty()) { filterContext.Controller.ViewData[ViewDataKeys.Zones] = new SelectList(zoneService.GetZonesByPageId(widget.PageID), "ID", "ZoneName"); } else if (!widget.LayoutID.IsNullOrEmpty()) { filterContext.Controller.ViewData[ViewDataKeys.Zones] = new SelectList(zoneService.GetZonesByLayoutId(widget.LayoutID), "ID", "ZoneName"); } } } }
public override WidgetPart Display(WidgetBase widget, System.Web.HttpContextBase httpContext) { return(base.Display(widget, httpContext)); }