protected virtual IEnumerable <ScriptDescriptor> GetScriptDescriptors()
        {
            // Don't render any scripts when partial rendering is not enabled
            if (Page != null && ScriptManager.SupportsPartialRendering && Visible)
            {
                ScriptControlDescriptor desc = new ScriptControlDescriptor("Sys.UI._UpdateProgress", ClientID);
                string updatePanelClientID   = null;
                if (!String.IsNullOrEmpty(AssociatedUpdatePanelID))
                {
                    // Try both the NamingContainer and the Page
                    UpdatePanel c = ControlUtil.FindTargetControl(AssociatedUpdatePanelID, this, true) as UpdatePanel;
                    if (c != null)
                    {
                        updatePanelClientID = c.ClientID;
                    }
                    else
                    {
                        throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, AtlasWeb.UpdateProgress_NoUpdatePanel, AssociatedUpdatePanelID));
                    }
                }
                desc.AddProperty("associatedUpdatePanelId", updatePanelClientID);
                desc.AddProperty("dynamicLayout", DynamicLayout);
                desc.AddProperty("displayAfter", DisplayAfter);
                yield return(desc);
            }

            yield break;
        }
Example #2
0
        protected Control FindTargetControl(bool searchNamingContainers)
        {
            if (String.IsNullOrEmpty(ControlID))
            {
                throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, AtlasWeb.UpdatePanelControlTrigger_NoControlID, Owner.ID));
            }
            Control foundControl = ControlUtil.FindTargetControl(ControlID, Owner, searchNamingContainers);

            if (foundControl == null)
            {
                throw new InvalidOperationException(String.Format(CultureInfo.InvariantCulture, AtlasWeb.UpdatePanelControlTrigger_ControlNotFound, ControlID, Owner.ID));
            }
            return(foundControl);
        }