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
- CurrentTimeZone.cs
- Documentation.cs
- CellTreeNode.cs
- SqlPersonalizationProvider.cs
- Positioning.cs
- UIElementIsland.cs
- DispatcherHooks.cs
- DataControlPagerLinkButton.cs
- ArgumentNullException.cs
- RecognizerInfo.cs
- ProcessModelSection.cs
- TextRunCache.cs
- ArgumentException.cs
- UnsafeNativeMethods.cs
- BamlVersionHeader.cs
- HttpResponse.cs
- CoreChannel.cs
- EventBuilder.cs
- _SslStream.cs
- DESCryptoServiceProvider.cs
- FontWeightConverter.cs
- CallbackValidatorAttribute.cs
- Intellisense.cs
- ToolConsole.cs
- RuntimeResourceSet.cs
- ServiceHostFactory.cs
- IndexedString.cs
- StaticSiteMapProvider.cs
- AsyncOperation.cs
- WpfSharedBamlSchemaContext.cs
- EncoderFallback.cs
- WebPartVerb.cs
- NativeCppClassAttribute.cs
- ObjectAnimationBase.cs
- XmlILConstructAnalyzer.cs
- Native.cs
- ByteStreamGeometryContext.cs
- FrugalList.cs
- ExclusiveTcpListener.cs
- ConditionedDesigner.cs
- ComboBox.cs
- MatrixCamera.cs
- Rotation3DKeyFrameCollection.cs
- ExpressionNode.cs
- HttpAsyncResult.cs
- MatrixCamera.cs
- EventMappingSettingsCollection.cs
- TypeConverterHelper.cs
- DashStyles.cs
- HtmlMeta.cs
- ExpressionVisitorHelpers.cs
- UIAgentAsyncBeginRequest.cs
- EventMappingSettings.cs
- InvokeWebService.cs
- BufferModeSettings.cs
- LinqDataSourceContextEventArgs.cs
- GeneratedCodeAttribute.cs
- Scanner.cs
- OutputCacheSettingsSection.cs
- ApplicationProxyInternal.cs
- unsafeIndexingFilterStream.cs
- VsPropertyGrid.cs
- ConfigurationConverterBase.cs
- PageBuildProvider.cs
- PropertyChangingEventArgs.cs
- HttpCachePolicyElement.cs
- AsnEncodedData.cs
- DetailsViewUpdatedEventArgs.cs
- DPAPIProtectedConfigurationProvider.cs
- EditorPart.cs
- glyphs.cs
- SvcMapFile.cs
- ReachDocumentPageSerializerAsync.cs
- NavigatingCancelEventArgs.cs
- _SslSessionsCache.cs
- shaperfactoryquerycachekey.cs
- WinHttpWebProxyFinder.cs
- FreezableDefaultValueFactory.cs
- ValidatorAttribute.cs
- NetTcpBinding.cs
- NativeCppClassAttribute.cs
- PeerNameResolver.cs
- SID.cs
- OdbcHandle.cs
- GroupItemAutomationPeer.cs
- StringWriter.cs
- RegisteredArrayDeclaration.cs
- TimelineCollection.cs
- processwaithandle.cs
- PublisherMembershipCondition.cs
- AutomationProperties.cs
- ZoneIdentityPermission.cs
- DummyDataSource.cs
- Range.cs
- exports.cs
- CommandConverter.cs
- TreeIterator.cs
- PageRanges.cs
- ObjectDataSourceMethodEventArgs.cs
- ConfigurationConverterBase.cs