語言

ITempData 介面

定義

提供字典以儲存後續請求所需的資料。 儲存在 TempData 的資料在讀取後會自動移除,除非Keep()Keep(String)被呼叫或Peek(String)透過 。

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))
實作

方法

名稱 Description
Get(String)

取得與指定金鑰相關的值,然後排程刪除。

Keep()

它會讓目前 TempData 中的所有金鑰持續存在,等待另一個請求。

Keep(String)

讓帶有 的 key 元素持續存在以進行另一個請求。

Peek(String)

取得與指定金鑰相關的值,且不會排程刪除。

適用於