Code:
/ Dotnetfx_Win7_3.5.1 / Dotnetfx_Win7_3.5.1 / 3.5.1 / DEVDIV / depot / DevDiv / releases / whidbey / NetFXspW7 / ndp / fx / src / xsp / System / Web / UI / WebControls / QueryStringParameter.cs / 1 / QueryStringParameter.cs
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.WebControls {
using System;
using System.ComponentModel;
using System.Data;
using System.Security.Permissions;
///
/// Represents a Parameter that gets its value from the application's QueryString parameters.
///
[
DefaultProperty("QueryStringField"),
]
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public class QueryStringParameter : Parameter {
///
/// Creates an instance of the QueryStringParameter class.
///
public QueryStringParameter() {
}
///
/// Creates an instance of the QueryStringParameter class with the specified parameter name and QueryString field.
///
public QueryStringParameter(string name, string queryStringField) : base(name) {
QueryStringField = queryStringField;
}
///
/// Creates an instance of the QueryStringParameter class with the specified parameter name, database type,
/// and QueryString field.
///
public QueryStringParameter(string name, DbType dbType, string queryStringField)
: base(name, dbType) {
QueryStringField = queryStringField;
}
///
/// Creates an instance of the QueryStringParameter class with the specified parameter name, type, and QueryString field.
///
public QueryStringParameter(string name, TypeCode type, string queryStringField) : base(name, type) {
QueryStringField = queryStringField;
}
///
/// Used to clone a parameter.
///
protected QueryStringParameter(QueryStringParameter original) : base(original) {
QueryStringField = original.QueryStringField;
}
///
/// The name of the QueryString parameter to get the value from.
///
[
DefaultValue(""),
WebCategory("Parameter"),
WebSysDescription(SR.QueryStringParameter_QueryStringField),
]
public string QueryStringField {
get {
object o = ViewState["QueryStringField"];
if (o == null)
return String.Empty;
return (string)o;
}
set {
if (QueryStringField != value) {
ViewState["QueryStringField"] = value;
OnParameterChanged();
}
}
}
///
/// Creates a new QueryStringParameter that is a copy of this QueryStringParameter.
///
protected override Parameter Clone() {
return new QueryStringParameter(this);
}
///
/// Returns the updated value of the parameter.
///
protected override object Evaluate(HttpContext context, Control control) {
if (context == null || context.Request == null) {
return null;
}
return context.Request.QueryString[QueryStringField];
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
//------------------------------------------------------------------------------
//
// Copyright (c) Microsoft Corporation. All rights reserved.
//
//-----------------------------------------------------------------------------
namespace System.Web.UI.WebControls {
using System;
using System.ComponentModel;
using System.Data;
using System.Security.Permissions;
///
/// Represents a Parameter that gets its value from the application's QueryString parameters.
///
[
DefaultProperty("QueryStringField"),
]
[AspNetHostingPermission(SecurityAction.LinkDemand, Level=AspNetHostingPermissionLevel.Minimal)]
[AspNetHostingPermission(SecurityAction.InheritanceDemand, Level=AspNetHostingPermissionLevel.Minimal)]
public class QueryStringParameter : Parameter {
///
/// Creates an instance of the QueryStringParameter class.
///
public QueryStringParameter() {
}
///
/// Creates an instance of the QueryStringParameter class with the specified parameter name and QueryString field.
///
public QueryStringParameter(string name, string queryStringField) : base(name) {
QueryStringField = queryStringField;
}
///
/// Creates an instance of the QueryStringParameter class with the specified parameter name, database type,
/// and QueryString field.
///
public QueryStringParameter(string name, DbType dbType, string queryStringField)
: base(name, dbType) {
QueryStringField = queryStringField;
}
///
/// Creates an instance of the QueryStringParameter class with the specified parameter name, type, and QueryString field.
///
public QueryStringParameter(string name, TypeCode type, string queryStringField) : base(name, type) {
QueryStringField = queryStringField;
}
///
/// Used to clone a parameter.
///
protected QueryStringParameter(QueryStringParameter original) : base(original) {
QueryStringField = original.QueryStringField;
}
///
/// The name of the QueryString parameter to get the value from.
///
[
DefaultValue(""),
WebCategory("Parameter"),
WebSysDescription(SR.QueryStringParameter_QueryStringField),
]
public string QueryStringField {
get {
object o = ViewState["QueryStringField"];
if (o == null)
return String.Empty;
return (string)o;
}
set {
if (QueryStringField != value) {
ViewState["QueryStringField"] = value;
OnParameterChanged();
}
}
}
///
/// Creates a new QueryStringParameter that is a copy of this QueryStringParameter.
///
protected override Parameter Clone() {
return new QueryStringParameter(this);
}
///
/// Returns the updated value of the parameter.
///
protected override object Evaluate(HttpContext context, Control control) {
if (context == null || context.Request == null) {
return null;
}
return context.Request.QueryString[QueryStringField];
}
}
}
// File provided for Reference Use Only by Microsoft Corporation (c) 2007.
Link Menu

This book is available now!
Buy at Amazon US or
Buy at Amazon UK
- BinaryFormatterWriter.cs
- RenderData.cs
- SplitterEvent.cs
- TypeValidationEventArgs.cs
- _ScatterGatherBuffers.cs
- BulletedList.cs
- GlyphElement.cs
- SqlConnectionFactory.cs
- VisualProxy.cs
- EntityDataSourceColumn.cs
- XmlSchemaRedefine.cs
- WriteFileContext.cs
- DataGridViewTopRowAccessibleObject.cs
- DateTimeEditor.cs
- MaskedTextProvider.cs
- CalendarTable.cs
- TextSelectionProcessor.cs
- ContainerSelectorBehavior.cs
- SiteMapPath.cs
- PermissionSetTriple.cs
- ControlParameter.cs
- ReadOnlyHierarchicalDataSourceView.cs
- HttpListenerPrefixCollection.cs
- FederatedMessageSecurityOverHttpElement.cs
- ObjectListComponentEditor.cs
- _NetworkingPerfCounters.cs
- TextTrailingWordEllipsis.cs
- AuthenticationModuleElementCollection.cs
- TypefaceCollection.cs
- BooleanSwitch.cs
- SHA384Managed.cs
- WaitHandle.cs
- SQLDecimalStorage.cs
- CodePageEncoding.cs
- GradientBrush.cs
- EditingContext.cs
- WebPartConnectionsCancelEventArgs.cs
- OutOfMemoryException.cs
- DataSpaceManager.cs
- FunctionImportElement.cs
- DataGridViewAdvancedBorderStyle.cs
- ComplexPropertyEntry.cs
- InkCollectionBehavior.cs
- DrawingContextDrawingContextWalker.cs
- WebBrowserEvent.cs
- XmlSchemaComplexContent.cs
- DescendantBaseQuery.cs
- HostedTcpTransportManager.cs
- ModelChangedEventArgsImpl.cs
- Compilation.cs
- DiscreteKeyFrames.cs
- Dispatcher.cs
- ListViewItem.cs
- SqlDataSourceCache.cs
- ParseHttpDate.cs
- Rect.cs
- ParentUndoUnit.cs
- PasswordRecoveryDesigner.cs
- ProfileGroupSettingsCollection.cs
- OutputCacheModule.cs
- ExpressionParser.cs
- XhtmlBasicLiteralTextAdapter.cs
- Object.cs
- DBSqlParserColumnCollection.cs
- dataSvcMapFileLoader.cs
- DCSafeHandle.cs
- NonParentingControl.cs
- CultureSpecificStringDictionary.cs
- ContextStaticAttribute.cs
- QilUnary.cs
- Command.cs
- Attributes.cs
- CompilationLock.cs
- FixedElement.cs
- EntityDataReader.cs
- TimerElapsedEvenArgs.cs
- SQLDecimalStorage.cs
- Int64Converter.cs
- WmpBitmapDecoder.cs
- XamlReaderHelper.cs
- ModifierKeysConverter.cs
- DataObjectSettingDataEventArgs.cs
- CSharpCodeProvider.cs
- RenderData.cs
- GeneralTransform3DTo2DTo3D.cs
- XamlSerializationHelper.cs
- DockPattern.cs
- DataSvcMapFile.cs
- SelectedCellsCollection.cs
- UIElementHelper.cs
- SafeSecurityHandles.cs
- SevenBitStream.cs
- VisualBrush.cs
- MessageHeader.cs
- DescendentsWalkerBase.cs
- SizeChangedEventArgs.cs
- JournalEntry.cs
- TimeSpanStorage.cs
- ServiceReference.cs
- Tool.cs