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
- BitSet.cs
- PermissionSetTriple.cs
- WebControlAdapter.cs
- ApplicationFileCodeDomTreeGenerator.cs
- PersonalizationState.cs
- WS2007FederationHttpBindingElement.cs
- _Connection.cs
- DropShadowEffect.cs
- CodeComment.cs
- TriggerAction.cs
- DbException.cs
- XmlTextReaderImplHelpers.cs
- EffectiveValueEntry.cs
- XmlSchemaAll.cs
- TextPattern.cs
- Rect3DValueSerializer.cs
- CanonicalFormWriter.cs
- PartialCachingControl.cs
- StatusBarPanelClickEvent.cs
- DataGridViewCellEventArgs.cs
- Decorator.cs
- ContainerUtilities.cs
- XPathDocumentBuilder.cs
- SqlCaseSimplifier.cs
- BrowserCapabilitiesFactoryBase.cs
- ColorConvertedBitmapExtension.cs
- DataPointer.cs
- TypeResolver.cs
- DisableDpiAwarenessAttribute.cs
- objectresult_tresulttype.cs
- PropertyTabAttribute.cs
- Hashtable.cs
- HttpDictionary.cs
- X509ChainElement.cs
- Header.cs
- control.ime.cs
- HandlerFactoryCache.cs
- ToolboxControl.cs
- BrowserCapabilitiesCompiler.cs
- IndexedString.cs
- RelatedImageListAttribute.cs
- SubqueryTrackingVisitor.cs
- Fonts.cs
- FormCollection.cs
- ArgumentException.cs
- BindStream.cs
- Stack.cs
- ViewLoader.cs
- localization.cs
- SecurityElement.cs
- DoubleAnimationClockResource.cs
- DefaultEventAttribute.cs
- AggregateNode.cs
- CodeDirectoryCompiler.cs
- IdnMapping.cs
- DependencyPropertyKind.cs
- PageCatalogPart.cs
- AdRotator.cs
- WebPartUserCapability.cs
- LicenseManager.cs
- Panel.cs
- OperationInfo.cs
- ActiveXHost.cs
- ToolbarAUtomationPeer.cs
- WindowsGraphicsWrapper.cs
- SingleKeyFrameCollection.cs
- ZipIOExtraField.cs
- MeasureItemEvent.cs
- ReverseInheritProperty.cs
- FormParameter.cs
- ObjectDataSource.cs
- PerformanceCounterCategory.cs
- FrameworkTextComposition.cs
- CurrencyWrapper.cs
- WebPartVerb.cs
- LeaseManager.cs
- ValidationSummaryDesigner.cs
- StylusCollection.cs
- RequestResizeEvent.cs
- BuildProviderAppliesToAttribute.cs
- TextBoxAutoCompleteSourceConverter.cs
- Int32Storage.cs
- WindowsRegion.cs
- CodeEventReferenceExpression.cs
- HtmlTextArea.cs
- RepeatButton.cs
- Soap.cs
- DocumentPageViewAutomationPeer.cs
- ModelUIElement3D.cs
- Int16AnimationBase.cs
- _NTAuthentication.cs
- TemplateColumn.cs
- DeclarationUpdate.cs
- ColorConvertedBitmapExtension.cs
- Triangle.cs
- CodeGotoStatement.cs
- StringStorage.cs
- WindowsGrip.cs
- LabelEditEvent.cs
- SqlConnectionStringBuilder.cs