TempDataAttribute Class

Definition

Properties decorated with TempDataAttribute will have their values stored in and loaded from the ITempDataDictionary. TempDataAttribute is supported on properties of Controllers, Razor Pages, and Razor Page Models.

C#
[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
public sealed class TempDataAttribute : Attribute
Inheritance
TempDataAttribute
Attributes

Constructors

Properties

Key

Gets or sets the key used to get or add the property from value from ITempDataDictionary. When unspecified, the key is derived from the property name.

Applies to

Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0