Code:
/ FXUpdate3074 / FXUpdate3074 / 1.1 / untmp / whidbey / QFE / ndp / fx / src / xsp / System / Web / UI / WebControls / ChildTable.cs / 3 / ChildTable.cs
//------------------------------------------------------------------------------ //// Copyright (c) Microsoft Corporation. All rights reserved. // //----------------------------------------------------------------------------- namespace System.Web.UI.WebControls { using System; using System.ComponentModel; using System.Web.UI; using System.Web.Util; [ ToolboxItem(false), SupportsEventValidation, ] ////// /// Used by composite controls that are based on a table, that only render /// their contents. /// Used to render out an ID attribute representing the parent composite control /// if an ID is not actually set on this table. /// internal class ChildTable : Table { private int _parentLevel; private string _parentID; private bool _parentIDSet; ///internal ChildTable() : this(1) { } /// internal ChildTable(int parentLevel) { Debug.Assert(parentLevel >= 1); _parentLevel = parentLevel; _parentIDSet = false; } internal ChildTable(string parentID) { _parentID = parentID; _parentIDSet = true; } /// protected override void AddAttributesToRender(HtmlTextWriter writer) { base.AddAttributesToRender(writer); string parentID = _parentID; if (!_parentIDSet) { parentID = GetParentID(); } if (parentID != null) { writer.AddAttribute(HtmlTextWriterAttribute.Id, parentID); } } /// /// Gets the ClientID of the parent whose ID is supposed to be used in the rendering. /// private string GetParentID() { if (ID != null) { return null; } Control parent = this; for (int i = 0; i < _parentLevel; i++) { parent = parent.Parent; if (parent == null) { break; } } Debug.Assert(parent != null); if (parent != null) { string id = parent.ID; if (!String.IsNullOrEmpty(id)) { return parent.ClientID; } } return null; } } } // File provided for Reference Use Only by Microsoft Corporation (c) 2007. // Copyright (c) Microsoft Corporation. All rights reserved.
Link Menu
This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- AddInPipelineAttributes.cs
- ReachIDocumentPaginatorSerializer.cs
- NamespaceInfo.cs
- SqlClientWrapperSmiStream.cs
- HeaderedItemsControl.cs
- XamlBuildTaskServices.cs
- Vertex.cs
- CheckBoxFlatAdapter.cs
- precedingsibling.cs
- ClientProxyGenerator.cs
- ThreadInterruptedException.cs
- ComplexTypeEmitter.cs
- Reference.cs
- HierarchicalDataSourceControl.cs
- StorageEndPropertyMapping.cs
- Document.cs
- ScriptHandlerFactory.cs
- VisualBrush.cs
- ItemsPresenter.cs
- FactoryGenerator.cs
- Internal.cs
- CertificateReferenceElement.cs
- AssociationSetEnd.cs
- FileClassifier.cs
- ObjectDataSourceStatusEventArgs.cs
- RandomDelayQueuedSendsAsyncResult.cs
- VerificationAttribute.cs
- WhiteSpaceTrimStringConverter.cs
- Permission.cs
- HtmlContainerControl.cs
- ProxyManager.cs
- IgnoreFlushAndCloseStream.cs
- TargetConverter.cs
- BaseCodePageEncoding.cs
- WindowsIdentity.cs
- DataGridViewCellEventArgs.cs
- glyphs.cs
- SocketElement.cs
- StorageEntityTypeMapping.cs
- QueryOutputWriter.cs
- TableRowsCollectionEditor.cs
- DictionaryMarkupSerializer.cs
- VisualCollection.cs
- ToolStripItemGlyph.cs
- GridViewSortEventArgs.cs
- CompilationLock.cs
- PaginationProgressEventArgs.cs
- StateChangeEvent.cs
- GlobalEventManager.cs
- ItemsPanelTemplate.cs
- DesignerOptionService.cs
- IisTraceListener.cs
- Cursors.cs
- SymDocumentType.cs
- DisposableCollectionWrapper.cs
- WinOEToolBoxItem.cs
- ObjectConverter.cs
- Camera.cs
- HttpPostedFile.cs
- TrustManagerPromptUI.cs
- HostingMessageProperty.cs
- XmlILStorageConverter.cs
- COM2TypeInfoProcessor.cs
- ProcessInfo.cs
- XamlTypeMapper.cs
- Contracts.cs
- NetCodeGroup.cs
- SecurityTokenSerializer.cs
- SerializableReadOnlyDictionary.cs
- Rect3DValueSerializer.cs
- TableLayoutPanelCellPosition.cs
- DSACryptoServiceProvider.cs
- TraceContextRecord.cs
- ResourceReader.cs
- WebPartConnectionsEventArgs.cs
- VirtualizedCellInfoCollection.cs
- Material.cs
- util.cs
- XamlPointCollectionSerializer.cs
- BindingsCollection.cs
- BitArray.cs
- EventsTab.cs
- WebServicesDescriptionAttribute.cs
- XsltContext.cs
- PolicyUnit.cs
- AsyncResult.cs
- IResourceProvider.cs
- BlurEffect.cs
- ErrorStyle.cs
- EventSetter.cs
- StylusSystemGestureEventArgs.cs
- EventTrigger.cs
- JpegBitmapEncoder.cs
- TimeEnumHelper.cs
- OleDbConnectionFactory.cs
- ClientApiGenerator.cs
- ProxyWebPartConnectionCollection.cs
- WebAdminConfigurationHelper.cs
- HttpHeaderCollection.cs
- Grid.cs