通过


ITempData 接口

定义

提供用于存储后续请求所需的数据的字典。 在读取 TempData 中存储的数据除非 Keep() 或被调用, Keep(String) 或者通过该 Peek(String)数据进行访问,否则会自动删除存储在 TempData 中的数据。

public interface ITempData : 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 ITempData = interface
    interface IDictionary<string, obj>
    interface ICollection<KeyValuePair<string, obj>>
    interface seq<KeyValuePair<string, obj>>
    interface IEnumerable
Public Interface ITempData
Implements ICollection(Of KeyValuePair(Of String, Object)), IDictionary(Of String, Object), IEnumerable(Of KeyValuePair(Of String, Object))
实现

方法

名称 说明
Get(String)

获取与指定键关联的值,然后计划其删除。

Keep()

使 TempData 中当前存在的所有密钥保留为另一个请求。

Keep(String)

为另一个请求保留元素 key

Peek(String)

获取与指定键关联的值,而无需计划删除它。

适用于