ViewDataDictionary<TModel> ViewDataDictionary<TModel> ViewDataDictionary<TModel> Class

Definition

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

public class ViewDataDictionary<TModel> : System.Web.Mvc.ViewDataDictionary
type ViewDataDictionary<'Model> = class
    inherit ViewDataDictionary
Public Class ViewDataDictionary(Of TModel)
Inherits ViewDataDictionary

Type Parameters

TModel

The type of the model.

Inheritance
ViewDataDictionary<TModel>ViewDataDictionary<TModel>ViewDataDictionary<TModel>

Constructors

ViewDataDictionary<TModel>() ViewDataDictionary<TModel>() ViewDataDictionary<TModel>()

Initializes a new instance of the ViewDataDictionary<TModel> class.

ViewDataDictionary<TModel>(TModel) ViewDataDictionary<TModel>(TModel) ViewDataDictionary<TModel>(TModel)

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

ViewDataDictionary<TModel>(ViewDataDictionary) ViewDataDictionary<TModel>(ViewDataDictionary) ViewDataDictionary<TModel>(ViewDataDictionary)

Initializes a new instance of the ViewDataDictionary<TModel> class by using the specified view data dictionary.

Properties

Count Count Count

Gets the number of elements in the collection.

(Inherited from ViewDataDictionary)
IsReadOnly IsReadOnly IsReadOnly

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

(Inherited from ViewDataDictionary)
Item[String] Item[String] Item[String]

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

(Inherited from ViewDataDictionary)
Keys Keys Keys

Gets a collection that contains the keys of this dictionary.

(Inherited from ViewDataDictionary)
Model Model Model

Gets or sets the model.

ModelMetadata ModelMetadata ModelMetadata

Gets or sets information about the model.

ModelState ModelState ModelState

Gets the state of the model.

(Inherited from ViewDataDictionary)
TemplateInfo TemplateInfo TemplateInfo

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

(Inherited from ViewDataDictionary)
Values Values Values

Gets a collection that contains the values in this dictionary.

(Inherited from ViewDataDictionary)

Methods

Add(KeyValuePair<String,Object>) Add(KeyValuePair<String,Object>) Add(KeyValuePair<String,Object>)

Adds the specified item to the collection.

(Inherited from ViewDataDictionary)
Add(String, Object) Add(String, Object) Add(String, Object)

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

(Inherited from ViewDataDictionary)
Clear() Clear() Clear()

Removes all items from the collection.

(Inherited from ViewDataDictionary)
Contains(KeyValuePair<String,Object>) Contains(KeyValuePair<String,Object>) Contains(KeyValuePair<String,Object>)

Determines whether the collection contains the specified item.

(Inherited from ViewDataDictionary)
ContainsKey(String) ContainsKey(String) ContainsKey(String)

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

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

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

(Inherited from ViewDataDictionary)
Eval(String) Eval(String) Eval(String)

Evaluates the specified expression.

(Inherited from ViewDataDictionary)
Eval(String, String) Eval(String, String) Eval(String, String)

Evaluates the specified expression by using the specified format.

(Inherited from ViewDataDictionary)
GetEnumerator() GetEnumerator() GetEnumerator()

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

(Inherited from ViewDataDictionary)
GetViewDataInfo(String) GetViewDataInfo(String) GetViewDataInfo(String)

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

(Inherited from ViewDataDictionary)
Remove(KeyValuePair<String,Object>) Remove(KeyValuePair<String,Object>) Remove(KeyValuePair<String,Object>)

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

(Inherited from ViewDataDictionary)
Remove(String) Remove(String) Remove(String)

Removes the element from the collection using the specified key.

(Inherited from ViewDataDictionary)
SetModel(Object) SetModel(Object) SetModel(Object)

Sets the data model to use for the view.

TryGetValue(String, Object) TryGetValue(String, Object) TryGetValue(String, Object)

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

(Inherited from ViewDataDictionary)

Explicit Interface Implementations

IEnumerable.GetEnumerator() IEnumerable.GetEnumerator() IEnumerable.GetEnumerator()

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

(Inherited from ViewDataDictionary)

Applies to