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
collection
NameValueCollectionA collection that contains the values that are used to initialize the provider.
unvalidatedCollection
NameValueCollectionA collection that contains the values that are used to initialize the provider. This collection will not be validated.
culture
CultureInfoAn 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
collection
NameValueCollectionKey value collection from request.
unvalidatedCollection
NameValueCollectionUnvalidated key value collection from the request.
culture
CultureInfoCulture with which the values are to be used.
jQueryToMvcRequestNormalizationRequired
booljQuery 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
collection
NameValueCollectionA collection that contains the values that are used to initialize the provider.
culture
CultureInfoAn object that contains information about the target culture.
Exceptions
- ArgumentNullException
The
collection
parameter is null.
Methods
ContainsPrefix(string)
Determines whether the collection contains the specified prefix.
public virtual bool ContainsPrefix(string prefix)
Parameters
prefix
stringThe prefix to search for.
Returns
- bool
true if the collection contains the specified prefix; otherwise, false.
Exceptions
- ArgumentNullException
The
prefix
parameter is null.
GetKeysFromPrefix(string)
Gets the keys using the specified prefix.
public virtual IDictionary<string, string> GetKeysFromPrefix(string prefix)
Parameters
prefix
stringThe prefix.
Returns
- IDictionary<string, string>
They keys.
GetValue(string)
Returns a value object using the specified key.
public virtual ValueProviderResult GetValue(string key)
Parameters
key
stringThe key of the value object to retrieve.
Returns
- ValueProviderResult
The value object for the specified key.
Exceptions
- ArgumentNullException
The
key
parameter 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.