ViewDataDictionary Class

Definition

Represents a container that is used to pass data between a controller and a view.

public class ViewDataDictionary : System.Collections.Generic.ICollection<System.Collections.Generic.KeyValuePair<string,object>>, System.Collections.Generic.IDictionary<string,object>, System.Collections.Generic.IEnumerable<System.Collections.Generic.KeyValuePair<string,object>>
type ViewDataDictionary = class
    interface IDictionary<string, obj>
    interface ICollection<KeyValuePair<string, obj>>
    interface seq<KeyValuePair<string, obj>>
    interface IEnumerable
Public Class ViewDataDictionary
Implements ICollection(Of KeyValuePair(Of String, Object)), IDictionary(Of String, Object), IEnumerable(Of KeyValuePair(Of String, Object))
Inheritance
ViewDataDictionary
Derived
Implements

Constructors

ViewDataDictionary()

Initializes a new instance of the ViewDataDictionary class.

ViewDataDictionary(Object)

Initializes a new instance of the ViewDataDictionary class by using the specified model.

ViewDataDictionary(ViewDataDictionary)

Initializes a new instance of the ViewDataDictionary class by using the specified dictionary.

Properties

Count

Gets the number of elements in the collection.

IsReadOnly

Gets a value that indicates whether the collection is read-only.

Item[String]

Gets or sets the item that is associated with the specified key.

Keys

Gets a collection that contains the keys of this dictionary.

Model

Gets or sets the model that is associated with the view data.

ModelMetadata

Gets or sets information about the model.

ModelState

Gets the state of the model.

TemplateInfo

Gets or sets an object that encapsulates information about the current template context.

Values

Gets a collection that contains the values in this dictionary.

Methods

Add(KeyValuePair<String,Object>)

Adds the specified item to the collection.

Add(String, Object)

Adds an element to the collection using the specified key and value .

Clear()

Removes all items from the collection.

Contains(KeyValuePair<String,Object>)

Determines whether the collection contains the specified item.

ContainsKey(String)

Determines whether the collection contains an element that has the specified key.

CopyTo(KeyValuePair<String,Object>[], Int32)

Copies the elements of the collection to an array, starting at a particular index.

Eval(String, String)

Evaluates the specified expression by using the specified format.

Eval(String)

Evaluates the specified expression.

GetEnumerator()

Returns an enumerator that can be used to iterate through the collection.

GetViewDataInfo(String)

Returns information about the view data as defined by the expression parameter.

Remove(KeyValuePair<String,Object>)

Removes the first occurrence of a specified object from the collection.

Remove(String)

Removes the element from the collection using the specified key.

SetModel(Object)

Sets the data model to use for the view.

TryGetValue(String, Object)

Attempts to retrieve the value that is associated with the specified key.

Explicit Interface Implementations

IEnumerable.GetEnumerator()

Returns an enumerator that can be used to iterate through the collection.

Applies to