/// <devdoc> /// </devdoc> protected internal virtual void RemovedControl(Control control) { if (control.OwnerControl != null) { throw new InvalidOperationException(SR.GetString(SR.Substitution_NotAllowed)); } if ((_namingContainer != null) && (control._id != null)) { _namingContainer.DirtyNameTable(); } // Controls may need to do their own cleanup. control.UnloadRecursive(false); control._parent = null; control._page = null; control._namingContainer = null; // Don't reset template source virtual directory on TemplateControl's, because // the path is their own, not their parent. i.e. it doesn't change no matter // where in the tree they end up. if (!(control is TemplateControl)) { if (control._occasionalFields != null) { control._occasionalFields.TemplateSourceVirtualDirectory = null; } } if (control._occasionalFields != null ) { control._occasionalFields.TemplateControl = null; } control.flags.Clear(mustRenderID); control.ClearCachedUniqueIDRecursive(); }
protected internal virtual void RemovedControl(Control control) { if (control.OwnerControl != null) { throw new InvalidOperationException(System.Web.SR.GetString("Substitution_NotAllowed")); } if ((this._namingContainer != null) && (control._id != null)) { this._namingContainer.DirtyNameTable(); } control.UnloadRecursive(false); control._parent = null; control._page = null; control._namingContainer = null; if (!(control is System.Web.UI.TemplateControl) && (control._occasionalFields != null)) { control._occasionalFields.TemplateSourceVirtualDirectory = null; } if (control._occasionalFields != null) { control._occasionalFields.TemplateControl = null; } control.flags.Clear(0x800); control.ClearCachedUniqueIDRecursive(); }