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
- DocumentViewerAutomationPeer.cs
- PlatformCulture.cs
- DataTableMapping.cs
- AbandonedMutexException.cs
- CachingHintValidation.cs
- SettingsPropertyNotFoundException.cs
- ScaleTransform.cs
- ConnectionManagementElementCollection.cs
- DataGridColumn.cs
- ClientSideQueueItem.cs
- SamlAuthorizationDecisionClaimResource.cs
- XPathSingletonIterator.cs
- ColumnMapTranslator.cs
- UIElementIsland.cs
- UIElement3DAutomationPeer.cs
- Method.cs
- DataGridViewCellLinkedList.cs
- DbCommandDefinition.cs
- ProviderCommandInfoUtils.cs
- XmlDomTextWriter.cs
- UnknownBitmapEncoder.cs
- SqlUnionizer.cs
- SecureStringHasher.cs
- SQLByte.cs
- EntityStoreSchemaGenerator.cs
- HMACSHA384.cs
- ClusterRegistryConfigurationProvider.cs
- QueryCursorEventArgs.cs
- HtmlDocument.cs
- CopyOnWriteList.cs
- TabPanel.cs
- DiscoveryClientDocuments.cs
- Menu.cs
- TimeSpanConverter.cs
- FunctionCommandText.cs
- Dictionary.cs
- Msec.cs
- DataControlField.cs
- ProxyHelper.cs
- ConnectorMovedEventArgs.cs
- DataGridTextBoxColumn.cs
- StorageMappingFragment.cs
- _AutoWebProxyScriptHelper.cs
- FlowDocumentFormatter.cs
- UnsafeNativeMethods.cs
- basenumberconverter.cs
- WebEventCodes.cs
- TemplateBamlRecordReader.cs
- WmlListAdapter.cs
- IntPtr.cs
- CodeNamespaceImportCollection.cs
- TextTreeRootNode.cs
- SafeLibraryHandle.cs
- DoWorkEventArgs.cs
- TimeIntervalCollection.cs
- HebrewCalendar.cs
- CollectionDataContract.cs
- StyleBamlTreeBuilder.cs
- GridViewDesigner.cs
- DateTimeOffset.cs
- DbConnectionFactory.cs
- TerminatorSinks.cs
- DetailsViewCommandEventArgs.cs
- WindowsProgressbar.cs
- followingquery.cs
- Italic.cs
- CodePageUtils.cs
- TranslateTransform.cs
- HtmlWindowCollection.cs
- Deflater.cs
- PopupControlService.cs
- NetworkAddressChange.cs
- XPathDocumentIterator.cs
- Symbol.cs
- SoapReflectionImporter.cs
- GroupBoxRenderer.cs
- ZoomPercentageConverter.cs
- QueryContinueDragEvent.cs
- DispatcherTimer.cs
- BookmarkWorkItem.cs
- TagPrefixCollection.cs
- VectorKeyFrameCollection.cs
- CounterCreationData.cs
- SqlCrossApplyToCrossJoin.cs
- COM2PictureConverter.cs
- IPPacketInformation.cs
- InstancePersistenceEvent.cs
- InputProcessorProfiles.cs
- DataControlPagerLinkButton.cs
- Properties.cs
- OdbcStatementHandle.cs
- SQLInt32.cs
- FormatControl.cs
- MenuItemStyleCollection.cs
- ToolStripDropTargetManager.cs
- StateItem.cs
- NetDataContractSerializer.cs
- HTTPAPI_VERSION.cs
- WorkflowServiceHostFactory.cs
- securitycriticaldataformultiplegetandset.cs