Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / DynamicData / DynamicData / DataBoundControlParameterTarget.cs / 1305376 / DataBoundControlParameterTarget.cs
namespace System.Web.DynamicData { using System; using System.Collections.Generic; using System.Linq; using System.Web.UI; using System.Web.UI.WebControls; using System.Globalization; internal class DataBoundControlParameterTarget : IControlParameterTarget { private Control _control; public DataBoundControlParameterTarget(Control control) { if (control == null) { throw new ArgumentNullException("control"); } _control = control; } public MetaTable Table { get { return _control.FindMetaTable(); } } public MetaColumn FilteredColumn { get { return null; } } public string GetPropertyNameExpression(string columnName) { // Get the DataKeyPropertyAttribute and use that as the to get the correct property name expression DataKeyPropertyAttribute attribute = _control.GetType().GetCustomAttributes(true).OfType().FirstOrDefault(); if ((attribute != null) && !String.IsNullOrEmpty(attribute.Name)) { return attribute.Name + String.Format(CultureInfo.InvariantCulture, "['{0}']", columnName); } // return String.Empty; } } } // 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
- RegexCompilationInfo.cs
- PropertyRef.cs
- CompilerInfo.cs
- ComboBoxItem.cs
- CalendarKeyboardHelper.cs
- XmlIterators.cs
- VirtualizingPanel.cs
- SettingsAttributes.cs
- FunctionCommandText.cs
- RegularExpressionValidator.cs
- SymmetricCryptoHandle.cs
- WCFBuildProvider.cs
- QilFactory.cs
- EntitySet.cs
- CompilerGlobalScopeAttribute.cs
- ConfigDefinitionUpdates.cs
- ByteStack.cs
- SweepDirectionValidation.cs
- SqlUDTStorage.cs
- DataBoundControl.cs
- ObjectDataProvider.cs
- MediaTimeline.cs
- StateMachineHelpers.cs
- WpfKnownType.cs
- ZipIOModeEnforcingStream.cs
- HttpResponse.cs
- BufferedGraphics.cs
- InputLanguageEventArgs.cs
- PageAdapter.cs
- DesignerAutoFormatCollection.cs
- CodeExporter.cs
- NativeMethods.cs
- ObjectDataSourceWizardForm.cs
- DbConnectionPoolIdentity.cs
- MailHeaderInfo.cs
- Ticks.cs
- CreateUserErrorEventArgs.cs
- OrderedDictionary.cs
- SqlCacheDependencyDatabaseCollection.cs
- ItemList.cs
- StateRuntime.cs
- _UncName.cs
- GeneralTransform3DTo2D.cs
- CellQuery.cs
- TableColumn.cs
- Descriptor.cs
- SqlCacheDependencyDatabaseCollection.cs
- RectangleGeometry.cs
- XmlDataLoader.cs
- CqlErrorHelper.cs
- ModelVisual3D.cs
- AppDomainAttributes.cs
- Column.cs
- GridViewDeleteEventArgs.cs
- SecureEnvironment.cs
- ErrorTableItemStyle.cs
- DataTableNewRowEvent.cs
- CustomAttributeBuilder.cs
- peersecuritysettings.cs
- MarginsConverter.cs
- CodeSubDirectoriesCollection.cs
- ContextMenu.cs
- TreeNode.cs
- DataGridViewLayoutData.cs
- SafeBitVector32.cs
- Matrix3DValueSerializer.cs
- ColorTransformHelper.cs
- ImageListUtils.cs
- ObjectListField.cs
- DescendentsWalkerBase.cs
- DataGridCellsPanel.cs
- SqlCachedBuffer.cs
- FigureParaClient.cs
- FlowLayoutPanel.cs
- SoundPlayerAction.cs
- CompositionTarget.cs
- ParagraphResult.cs
- QilScopedVisitor.cs
- LinqDataSource.cs
- FacetValueContainer.cs
- AudioStateChangedEventArgs.cs
- CollectionViewGroup.cs
- RuntimeCompatibilityAttribute.cs
- GridViewSortEventArgs.cs
- TabOrder.cs
- ContentHostHelper.cs
- HScrollProperties.cs
- ListItemParagraph.cs
- DetailsViewInsertedEventArgs.cs
- XmlIterators.cs
- XPathParser.cs
- TypeSystem.cs
- Soap12ProtocolImporter.cs
- AppSettingsSection.cs
- ExtensionSimplifierMarkupObject.cs
- ToolStrip.cs
- SiteMapProvider.cs
- WebPartHeaderCloseVerb.cs
- Array.cs
- WizardPanelChangingEventArgs.cs