コード例 #1
0
        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");
                    }
                }
            }
        }
コード例 #2
0
 public override WidgetPart Display(WidgetBase widget, System.Web.HttpContextBase httpContext)
 {
     return(base.Display(widget, httpContext));
 }