Page.Items 屬性


取得頁面內容中儲存的物件清單。Gets a list of objects stored in the page context.

 property System::Collections::IDictionary ^ Items { System::Collections::IDictionary ^ get(); };
public System.Collections.IDictionary Items { get; }
member this.Items : System.Collections.IDictionary
Public ReadOnly Property Items As IDictionary


IDictionary 的參考,其中包含頁面內容中儲存的物件。A reference to an IDictionary containing objects stored in the page context.



使用 [Items] 屬性,即可儲存具有與頁面要求相同之存留期的物件。Use the Items property to store objects with the same lifetime as the page request. 這個屬性是唯讀的;不過,您可以將物件新增至它所傳回的 IDictionary 物件。This property is read-only; however, you can add objects to the IDictionary object it returns.

加入至 Items 屬性的物件可在頁面的整個存留期間使用,因此,您可以在頁面生命週期初期的事件中,將物件新增至 Items 屬性,並在稍後的事件中存取這些物件。Objects added to the Items property are available throughout the lifetime of the page, so you can add objects to the Items property in events early in the page life cycle and access those objects in later events.