Code:
/ 4.0 / 4.0 / 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 IEnumerableGetWhereParameters(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. 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 IEnumerableGetWhereParameters(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
- RtfFormatStack.cs
- XmlSerializerNamespaces.cs
- Control.cs
- AsyncStreamReader.cs
- LassoSelectionBehavior.cs
- DetailsViewCommandEventArgs.cs
- OpenTypeLayoutCache.cs
- SqlBinder.cs
- EventDescriptorCollection.cs
- WhitespaceRuleReader.cs
- ContentTextAutomationPeer.cs
- XmlSerializerObjectSerializer.cs
- MethodBuilderInstantiation.cs
- UdpRetransmissionSettings.cs
- ShapeTypeface.cs
- PersonalizationDictionary.cs
- ImageButton.cs
- XsdDateTime.cs
- RecommendedAsConfigurableAttribute.cs
- SqlDependencyListener.cs
- FileDialogCustomPlacesCollection.cs
- DbDataReader.cs
- FrameworkContextData.cs
- WindowsStartMenu.cs
- Stack.cs
- TimeoutValidationAttribute.cs
- DataGridViewCellValidatingEventArgs.cs
- SuppressMergeCheckAttribute.cs
- SimplePropertyEntry.cs
- PointAnimationClockResource.cs
- AutoScrollHelper.cs
- TargetParameterCountException.cs
- SessionEndingEventArgs.cs
- ScrollPatternIdentifiers.cs
- TextParentUndoUnit.cs
- IndexedEnumerable.cs
- HttpContext.cs
- TextEditorCharacters.cs
- RepeaterItemCollection.cs
- UIElementIsland.cs
- CodePageUtils.cs
- errorpatternmatcher.cs
- MatrixConverter.cs
- LogConverter.cs
- RegexTree.cs
- OutputScopeManager.cs
- EncodingNLS.cs
- RichTextBoxContextMenu.cs
- BitmapEffectOutputConnector.cs
- Token.cs
- TextTrailingCharacterEllipsis.cs
- serverconfig.cs
- SoapReflector.cs
- BeginEvent.cs
- SeverityFilter.cs
- EventHandlerService.cs
- DataGridViewRowConverter.cs
- MethodRental.cs
- WpfKnownType.cs
- WebBrowserNavigatedEventHandler.cs
- TypeUtils.cs
- TypeSystemHelpers.cs
- LinkLabel.cs
- EditorZone.cs
- ImageCodecInfo.cs
- CodePrimitiveExpression.cs
- SqlTriggerContext.cs
- SafeProcessHandle.cs
- MailMessageEventArgs.cs
- SaveFileDialog.cs
- altserialization.cs
- IriParsingElement.cs
- InstanceDataCollection.cs
- ProfileServiceManager.cs
- PolygonHotSpot.cs
- ExtractorMetadata.cs
- DataGridViewSelectedColumnCollection.cs
- DisplayNameAttribute.cs
- SettingsBase.cs
- OpCodes.cs
- SectionUpdates.cs
- ConfigurationStrings.cs
- SemanticBasicElement.cs
- StringResourceManager.cs
- WorkflowRuntime.cs
- PixelShader.cs
- TypeValidationEventArgs.cs
- UserControl.cs
- ArrayTypeMismatchException.cs
- StringStorage.cs
- DecimalConstantAttribute.cs
- MenuTracker.cs
- X509ChainElement.cs
- BitmapEffectInputConnector.cs
- Merger.cs
- PasswordRecovery.cs
- EncoderParameters.cs
- RbTree.cs
- FlowNode.cs
- WebBrowserPermission.cs