Exemple #1
0
        /// <summary>
        /// Returns Data dictionary from Parent update panel or from Root
        /// </summary>
        /// <param name="panel"></param>
        /// <returns></returns>
        public static IDictionary <string, object> ParentData(this UpdatePanelScope panel)
        {
            var parent = panel.Parent();
            var res    = parent != null?parent.Data() : panel.Page.ActionData();

            return(res);
        }
Exemple #2
0
        public static bool ShouldRenderParent(this UpdatePanelScope scope)
        {
            var parent = scope.Parent();

            if (parent != null)
            {
                return(parent.ShouldRender());
            }
            return(scope.Requested() == UpdatePanelRequestType.EntireView);
        }
Exemple #3
0
        public static bool ShouldRender(this UpdatePanelScope panel)
        {
            var parent             = panel.Parent();
            var parentShouldRender = parent != null?parent.ShouldRender() : true;   //root is true

            switch (panel.Requested())
            {
            case UpdatePanelRequestType.CurrentPanel:
                return(true);

            case UpdatePanelRequestType.EntireView:
            case UpdatePanelRequestType.Parent:
                return(parentShouldRender && panel.Settings.LoadMode == UpdatePanelLoadMode.RenderWithParent);

            case UpdatePanelRequestType.OtherPanel:
            case UpdatePanelRequestType.ChildPanel:
            default:
                return(false);
            }
        }