语言

TempDataAttribute 类

定义

使用 TempDataAttribute 修饰的属性会将其值存储在 中,并从 中加载 ITempDataDictionary。 TempDataAttribute 控制器、Razor 页面和 Razor 页面模型的属性支持。

public ref class TempDataAttribute sealed : Attribute
[System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)]
public sealed class TempDataAttribute : Attribute
[<System.AttributeUsage(System.AttributeTargets.Property, AllowMultiple=false, Inherited=true)>]
type TempDataAttribute = class
    inherit Attribute
Public NotInheritable Class TempDataAttribute
Inherits Attribute
继承
TempDataAttribute
属性

构造函数

名称 说明
TempDataAttribute()

使用 TempDataAttribute 修饰的属性会将其值存储在 中,并从 中加载 ITempDataDictionary。 TempDataAttribute 控制器、Razor 页面和 Razor 页面模型的属性支持。

属性

名称 说明
Key

获取或设置用于从 ITempDataDictionary值获取或添加属性的键。 如果未指定,则密钥派生自属性名称。

适用于