Page.Application 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得目前 Web 要求的 HttpApplicationState 物件。
public:
property System::Web::HttpApplicationState ^ Application { System::Web::HttpApplicationState ^ get(); };
[System.ComponentModel.Browsable(false)]
public System.Web.HttpApplicationState Application { get; }
[<System.ComponentModel.Browsable(false)>]
member this.Application : System.Web.HttpApplicationState
Public ReadOnly Property Application As HttpApplicationState
屬性值
HttpApplicationState 類別中目前的資料。
- 屬性
範例
// When this page is loaded, the source for the
// MyDataGrid control is obtained from Application state.
void Page_Load(object sender, EventArgs e ) {
DataView Source = (DataView)(Application["Source"]);
MySpan.Controls.Add(new LiteralControl(Source.Table.TableName));
MyDataGrid.DataSource = Source;
MyDataGrid.DataBind();
}
' When this page is loaded, the source for the
' MyDataGrid control is obtained from Application state.
Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs)
Dim Source As DataView = Application("Source")
MySpan.Controls.Add(New LiteralControl(Source.Table.TableName))
MyDataGrid.DataSource = Source
MyDataGrid.DataBind()
End Sub