Code:
/ DotNET / DotNET / 8.0 / untmp / whidbey / REDBITS / ndp / fx / src / xsp / System / Web / UI / WebControls / CompositeControl.cs / 1 / CompositeControl.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System.ComponentModel; using System.Security.Permissions; ////// Base class for composite controls -- controls that contain other controls and reuse their functionality /// via class composition. See Chapter 12 in "Developing Microsoft ASP.NET Server Controls and Components." /// The following classes have copied code from this class (look for "Copied from CompositeControl" comment): /// - ChangePassword /// - Login /// - LoginView /// - SiteMapPath /// [ Designer("System.Web.UI.Design.WebControls.CompositeControlDesigner, " + AssemblyRef.SystemDesign) ] [AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)] [AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)] public abstract class CompositeControl : WebControl, INamingContainer, ICompositeControlDesignerAccessor { ////// Ensure that the child controls have been created before returning the controls collection /// public override ControlCollection Controls { get { EnsureChildControls(); return base.Controls; } } ////// Perform our own databinding, then perform our child controls' databinding. /// Does not call Base.DataBind(), since we need to call EnsureChildControls() between /// OnDataBinding() and DataBindChildren(). /// public override void DataBind() { OnDataBinding(EventArgs.Empty); EnsureChildControls(); DataBindChildren(); } protected virtual void RecreateChildControls() { ChildControlsCreated = false; EnsureChildControls(); } // Needed so the CompositeControl renders correctly in the designer, even when it does not have // an associated ControlDesigner (i.e. it is a child control of another CompositeControl). protected internal override void Render(HtmlTextWriter writer) { if (DesignMode) { EnsureChildControls(); } base.Render(writer); } #region ICompositeControlDesignerAccessor implementation void ICompositeControlDesignerAccessor.RecreateChildControls() { RecreateChildControls(); } #endregion } }
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- KeyBinding.cs
- VisualBrush.cs
- XslCompiledTransform.cs
- ViewCellRelation.cs
- DataGridViewRowPostPaintEventArgs.cs
- Function.cs
- PaperSource.cs
- InheritanceContextHelper.cs
- PersonalizablePropertyEntry.cs
- PasswordRecovery.cs
- Viewport3DAutomationPeer.cs
- SessionStateItemCollection.cs
- BackStopAuthenticationModule.cs
- Activity.cs
- DesignerEventService.cs
- MenuItem.cs
- InlineUIContainer.cs
- TemplateBindingExpression.cs
- InProcStateClientManager.cs
- Vector3dCollection.cs
- KnowledgeBase.cs
- Root.cs
- XmlUtil.cs
- ContextItemManager.cs
- XmlBinaryWriterSession.cs
- SerialReceived.cs
- Positioning.cs
- TcpAppDomainProtocolHandler.cs
- SymbolMethod.cs
- GridViewRowPresenter.cs
- XPathDocument.cs
- TimerElapsedEvenArgs.cs
- Certificate.cs
- IndexedString.cs
- ExeConfigurationFileMap.cs
- JsonCollectionDataContract.cs
- SendMessageRecord.cs
- SoundPlayer.cs
- SecurityPermission.cs
- ResXResourceWriter.cs
- KeyInterop.cs
- AsyncStreamReader.cs
- Roles.cs
- SchemaImporterExtension.cs
- PortCache.cs
- SqlComparer.cs
- SystemIPAddressInformation.cs
- ScopedKnownTypes.cs
- RoleGroup.cs
- BuildProviderUtils.cs
- OracleDateTime.cs
- DrawingGroup.cs
- OleDbDataReader.cs
- _NegoState.cs
- StructuredTypeEmitter.cs
- CalendarDateRange.cs
- Substitution.cs
- BindingsCollection.cs
- Connector.cs
- EntityCommandDefinition.cs
- SqlNodeAnnotation.cs
- ScaleTransform3D.cs
- TextSerializer.cs
- OdbcConnectionFactory.cs
- Rotation3D.cs
- NotSupportedException.cs
- SeparatorAutomationPeer.cs
- PropertyGridEditorPart.cs
- InputBinding.cs
- BorderGapMaskConverter.cs
- ArgIterator.cs
- LinqDataSourceDisposeEventArgs.cs
- UserControl.cs
- ServicePrincipalNameElement.cs
- OuterProxyWrapper.cs
- HtmlAnchor.cs
- HttpCookie.cs
- DebugController.cs
- SqlProfileProvider.cs
- NullReferenceException.cs
- TriggerCollection.cs
- IFlowDocumentViewer.cs
- UInt64.cs
- SQLUtility.cs
- SingleKeyFrameCollection.cs
- BitmapMetadata.cs
- LogSwitch.cs
- RichTextBoxAutomationPeer.cs
- XmlSecureResolver.cs
- ObjectSerializerFactory.cs
- WinFormsSecurity.cs
- HtmlInputControl.cs
- CodeCatchClauseCollection.cs
- FrameworkElementAutomationPeer.cs
- FileSecurity.cs
- XPathAncestorIterator.cs
- OrderByExpression.cs
- Mutex.cs
- InstalledVoice.cs
- BinHexDecoder.cs