This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Note
Access to this page requires authorization. You can trysigning in orchanging directories.
Access to this page requires authorization. You can trychanging directories.
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Properties decorated withViewDataAttribute will have their values stored inand loaded from theViewDataDictionary.ViewDataDictionaryis supported on properties of Controllers, and Razor Page handlers.
public ref class ViewDataAttribute sealed : Attribute[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)]public sealed class ViewDataAttribute : Attribute[<System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)>]type ViewDataAttribute = class inherit AttributePublic NotInheritable Class ViewDataAttributeInherits Attribute| Name | Description |
|---|---|
| ViewDataAttribute() | |
| Name | Description |
|---|---|
| Key | Gets or sets the key used to get or add the property from value fromViewDataDictionary.When unspecified, the key is the property name. |
Was this page helpful?
Need help with this topic?
Want to try using Ask Learn to clarify or guide you through this topic?
Was this page helpful?
Want to try using Ask Learn to clarify or guide you through this topic?