Class NameValueCollectionValueProvider
Represents the base class for value providers whose values come from a NameValueCollection object.
public class NameValueCollectionValueProvider : IUnvalidatedValueProvider, IEnumerableValueProvider, IValueProvider
- Inheritance
-
NameValueCollectionValueProvider
- Implements
- Derived
- Inherited Members
Constructors
NameValueCollectionValueProvider(NameValueCollection, NameValueCollection, CultureInfo)
Initializes a new instance of the NameValueCollectionValueProvider class using the specified unvalidated collection.
public NameValueCollectionValueProvider(NameValueCollection collection, NameValueCollection unvalidatedCollection, CultureInfo culture)
Parameters
collectionNameValueCollectionA collection that contains the values that are used to initialize the provider.
unvalidatedCollectionNameValueCollectionA collection that contains the values that are used to initialize the provider. This collection will not be validated.
cultureCultureInfoAn object that contains information about the target culture.
NameValueCollectionValueProvider(NameValueCollection, NameValueCollection, CultureInfo, bool)
Initializes Name Value collection provider.
public NameValueCollectionValueProvider(NameValueCollection collection, NameValueCollection unvalidatedCollection, CultureInfo culture, bool jQueryToMvcRequestNormalizationRequired)
Parameters
collectionNameValueCollectionKey value collection from request.
unvalidatedCollectionNameValueCollectionUnvalidated key value collection from the request.
cultureCultureInfoCulture with which the values are to be used.
jQueryToMvcRequestNormalizationRequiredbooljQuery POST when sending complex Javascript objects to server does not encode in the way understandable by MVC. This flag should be set if the request should be normalized to MVC form - https://aspnetwebstack.codeplex.com/workitem/1564.
NameValueCollectionValueProvider(NameValueCollection, CultureInfo)
Initializes a new instance of the NameValueCollectionValueProvider class.
public NameValueCollectionValueProvider(NameValueCollection collection, CultureInfo culture)
Parameters
collectionNameValueCollectionA collection that contains the values that are used to initialize the provider.
cultureCultureInfoAn object that contains information about the target culture.
Exceptions
- ArgumentNullException
The
collectionparameter is null.
Methods
ContainsPrefix(string)
Determines whether the collection contains the specified prefix.
public virtual bool ContainsPrefix(string prefix)
Parameters
prefixstringThe prefix to search for.
Returns
- bool
true if the collection contains the specified prefix; otherwise, false.
Exceptions
- ArgumentNullException
The
prefixparameter is null.
GetKeysFromPrefix(string)
Gets the keys using the specified prefix.
public virtual IDictionary<string, string> GetKeysFromPrefix(string prefix)
Parameters
prefixstringThe prefix.
Returns
- IDictionary<string, string>
They keys.
GetValue(string)
Returns a value object using the specified key.
public virtual ValueProviderResult GetValue(string key)
Parameters
keystringThe key of the value object to retrieve.
Returns
- ValueProviderResult
The value object for the specified key.
Exceptions
- ArgumentNullException
The
keyparameter is null.
GetValue(string, bool)
Returns a value object using the specified key and validation directive.
public virtual ValueProviderResult GetValue(string key, bool skipValidation)
Parameters
Returns
- ValueProviderResult
The value object for the specified key.