Code:
/ 4.0 / 4.0 / untmp / DEVDIV_TFS / Dev10 / Releases / RTMRel / ndp / fx / src / xsp / System / DynamicData / DynamicData / DynamicQueryStringParameter.cs / 1305376 / DynamicQueryStringParameter.cs
using System.Collections.Generic;
using System.Globalization;
using System.Web.DynamicData.Util;
using System.Web.Resources;
using System.Web.UI;
using System.Web.UI.WebControls;
namespace System.Web.DynamicData {
///
/// DynamicQueryStringParameter allows a datasource to have its primary key easily fed from the query string.
/// It does not require any attributes, and works even for multi-part primary keys.
///
public class DynamicQueryStringParameter : Parameter, IWhereParametersProvider {
///
/// See IWhereParametersProvider.GetWhereParameters
///
public virtual IEnumerable GetWhereParameters(IDynamicDataSource dataSource) {
var table = MetaTableHelper.GetTableWithFullFallback(dataSource, HttpContext.Current.ToWrapper());
// check makes no sense as the above call will throw
//if (table == null) {
// return new Parameter[0];
//}
return RouteParametersHelper.GetColumnParameters(table, Name);
}
///
/// same as base
///
///
///
///
protected override object Evaluate(HttpContext context, Control control) {
// If this gets called, it means we never had a chance to expand the parameter. Give an error
// telling the user to use a DynamicDataManager
throw new InvalidOperationException(String.Format(
CultureInfo.CurrentCulture, DynamicDataResources.DynamicParameter_NeedExpansion, typeof(DynamicQueryStringParameter).Name));
}
}
}
// 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
- HitTestWithPointDrawingContextWalker.cs
- Certificate.cs
- InternalsVisibleToAttribute.cs
- SiteMapPath.cs
- IntegerValidatorAttribute.cs
- TableLayoutPanel.cs
- Win32KeyboardDevice.cs
- ExpressionEditorAttribute.cs
- SelectionEditingBehavior.cs
- BrowserCapabilitiesCompiler.cs
- RedistVersionInfo.cs
- VersionValidator.cs
- CalculatedColumn.cs
- ReadOnlyDictionary.cs
- ProcessModelSection.cs
- XPathAxisIterator.cs
- CatalogZoneBase.cs
- UncommonField.cs
- DataRowExtensions.cs
- Splitter.cs
- exports.cs
- CompositeTypefaceMetrics.cs
- safex509handles.cs
- ColorMatrix.cs
- AssemblyBuilderData.cs
- GregorianCalendar.cs
- PreDigestedSignedInfo.cs
- WSHttpBindingBaseElement.cs
- RolePrincipal.cs
- TraceSection.cs
- TextDecorationUnitValidation.cs
- EpmCustomContentSerializer.cs
- ComponentSerializationService.cs
- X509Chain.cs
- XPathChildIterator.cs
- BindingCompleteEventArgs.cs
- AsyncMethodInvoker.cs
- DataGridViewBand.cs
- SelectorAutomationPeer.cs
- XmlTextReader.cs
- DebuggerAttributes.cs
- AssemblyBuilder.cs
- ADConnectionHelper.cs
- BamlReader.cs
- MenuItemCollection.cs
- SrgsNameValueTag.cs
- AppDomainProtocolHandler.cs
- FormViewDeletedEventArgs.cs
- PrintDialog.cs
- TailCallAnalyzer.cs
- XmlLanguageConverter.cs
- __FastResourceComparer.cs
- AvTraceDetails.cs
- MessageLoggingFilterTraceRecord.cs
- ConstructorNeedsTagAttribute.cs
- ResourceCategoryAttribute.cs
- CodeDOMUtility.cs
- HitTestFilterBehavior.cs
- CodeTypeConstructor.cs
- BindableAttribute.cs
- Propagator.JoinPropagator.cs
- LinqMaximalSubtreeNominator.cs
- BufferBuilder.cs
- CngProperty.cs
- OleAutBinder.cs
- PictureBoxDesigner.cs
- BridgeDataRecord.cs
- TriggerAction.cs
- ProjectionPruner.cs
- WindowsListViewGroupHelper.cs
- DataGridPageChangedEventArgs.cs
- BitVector32.cs
- ManipulationInertiaStartingEventArgs.cs
- DebuggerService.cs
- DocumentViewer.cs
- XMLDiffLoader.cs
- EntityModelBuildProvider.cs
- RenderDataDrawingContext.cs
- ObjectCloneHelper.cs
- CommandPlan.cs
- BaseCodePageEncoding.cs
- Touch.cs
- AtomParser.cs
- DependencyPropertyConverter.cs
- TrackingDataItem.cs
- IndicCharClassifier.cs
- InvalidFilterCriteriaException.cs
- SecureConversationVersion.cs
- DataGridViewSelectedRowCollection.cs
- CompiledQueryCacheKey.cs
- BinaryMethodMessage.cs
- Point4D.cs
- DependencyProperty.cs
- ComponentEditorPage.cs
- ObjectQueryExecutionPlan.cs
- ListBoxItemAutomationPeer.cs
- ScrollableControl.cs
- BinaryObjectWriter.cs
- EventHandlerList.cs
- CalendarAutomationPeer.cs