Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / DynamicData / DynamicData / DynamicRouteExpression.cs / 1305376 / DynamicRouteExpression.cs
using System.Collections; using System.Collections.Generic; using System.ComponentModel; using System.Linq; using System.Web.DynamicData.Util; using System.Web.UI; using System.Web.UI.WebControls; using System.Diagnostics; #if ORYX_VNEXT using Microsoft.Web.Data.UI.WebControls.Expressions; using Microsoft.Web.Data.UI.WebControls; #else using System.Web.UI.WebControls.Expressions; #endif namespace System.Web.DynamicData { ////// This class is an QueryExtender-based equivalent of DynamicQueryStringParameters. /// When applied to a data source it will filter the data by the value of a primary key encoded /// in the requests query string (or potentially routing if complex routes are used). If ColumnName /// is specified it will retrieve the values /// public class DynamicRouteExpression : DataSourceExpression { private PropertyExpression _expression = new PropertyExpression(); ////// An optional column name that can be used to change the filtering mode (i.e. filter by foreign key instead /// of primary key). /// [DefaultValue("")] public string ColumnName { get; set; } ////// See base class. /// public override void SetContext(Control owner, HttpContext context, IQueryableDataSource dataSource) { base.SetContext(owner, context, dataSource); owner.Page.InitComplete += new EventHandler(Page_InitComplete); } void Page_InitComplete(object sender, EventArgs e) { Debug.Assert(DataSource != null); var table = DataSource.GetMetaTable(); IEnumerableparameters = RouteParametersHelper.GetColumnParameters(table, ColumnName); parameters.ToList().ForEach(p => _expression.Parameters.Add(p)); } /// /// See base class. /// public override IQueryable GetQueryable(IQueryable source) { return _expression.GetQueryable(source); } } } // 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
- DisplayInformation.cs
- CounterSample.cs
- TextViewSelectionProcessor.cs
- MsmqElementBase.cs
- ScrollPattern.cs
- Int16AnimationUsingKeyFrames.cs
- ArgIterator.cs
- TempEnvironment.cs
- WpfPayload.cs
- RtfToXamlLexer.cs
- WinFormsComponentEditor.cs
- ContainerControl.cs
- CryptoStream.cs
- IdentityManager.cs
- SqlFlattener.cs
- ApplicationBuildProvider.cs
- MailBnfHelper.cs
- AspNetHostingPermission.cs
- ResourceProperty.cs
- ColumnHeader.cs
- ConnectionStringSettingsCollection.cs
- QueryableDataSourceEditData.cs
- XmlSchemaSimpleTypeList.cs
- Section.cs
- ColumnMapVisitor.cs
- Dynamic.cs
- EnumMemberAttribute.cs
- StateDesigner.cs
- XmlEventCache.cs
- HashSetEqualityComparer.cs
- StartUpEventArgs.cs
- FramingChannels.cs
- ListQueryResults.cs
- LifetimeServices.cs
- TreeNodeClickEventArgs.cs
- KeyFrames.cs
- CompilerCollection.cs
- ConfigXmlAttribute.cs
- Application.cs
- MessageQueueTransaction.cs
- BuildProvidersCompiler.cs
- ScrollBarAutomationPeer.cs
- PassportAuthenticationEventArgs.cs
- SoapCommonClasses.cs
- ThreadInterruptedException.cs
- Util.cs
- WebPartConnectionsConfigureVerb.cs
- MetadataArtifactLoaderFile.cs
- WebBrowserNavigatingEventHandler.cs
- SuppressIldasmAttribute.cs
- FixedSOMElement.cs
- ProcessHost.cs
- Activator.cs
- SimpleFileLog.cs
- initElementDictionary.cs
- Constants.cs
- XPathConvert.cs
- ContentControl.cs
- BindingOperations.cs
- Int16AnimationUsingKeyFrames.cs
- CodeSnippetStatement.cs
- ProcessHostFactoryHelper.cs
- WebPartDisplayModeCollection.cs
- typedescriptorpermission.cs
- OleServicesContext.cs
- NetWebProxyFinder.cs
- SqlServer2KCompatibilityCheck.cs
- DataGridDefaultColumnWidthTypeConverter.cs
- MostlySingletonList.cs
- ObjectComplexPropertyMapping.cs
- EventDriven.cs
- Stackframe.cs
- documentation.cs
- FontWeights.cs
- followingsibling.cs
- FragmentQueryKB.cs
- ViewStateModeByIdAttribute.cs
- BaseAsyncResult.cs
- RelatedCurrencyManager.cs
- ObjectStateEntryDbUpdatableDataRecord.cs
- BinaryMethodMessage.cs
- SafeRightsManagementEnvironmentHandle.cs
- SimpleLine.cs
- XmlAttributes.cs
- TableSectionStyle.cs
- WithStatement.cs
- XmlSiteMapProvider.cs
- TraceLevelHelper.cs
- URL.cs
- XamlReader.cs
- UrlPropertyAttribute.cs
- ResourceExpressionBuilder.cs
- TemplateNameScope.cs
- XmlReaderSettings.cs
- ApplicationGesture.cs
- ControlPaint.cs
- TimeSpanHelper.cs
- DbCommandDefinition.cs
- PeerNameRecord.cs
- ObjectItemConventionAssemblyLoader.cs