クライアント ポストバックへの応答としてページを読み込んでいるのか、初めてページを読み込んでアクセスしているのかを示す値を取得します。
Public ReadOnly Property IsPostBack As Boolean
[C#]
public bool IsPostBack {get;}
[C++]
public: __property bool get_IsPostBack();
[JScript]
public function get IsPostBack() : Boolean;
プロパティ値
ページがクライアント ポストバックへの応答として読み込まれている場合は true 。それ以外の場合は false 。
使用例
[Visual Basic, C#, JScript] Page が読み込まれるときに、すべての検証サーバー コントロールの Page.Validate メソッドを条件付きで呼び出す IsPostBack プロパティの値をテストする例を次に示します。
Sub Page_Load
If Not IsPostBack
' Validate initially to force the asterisks
' to appear before the first roundtrip.
Validate()
End If
End Sub
[C#]
void Page_Load() {
if (!IsPostBack) {
// Validate initially to force asterisks
// to appear before the first roundtrip.
Validate();
}
}
[JScript]
function Page_Load() {
if (!IsPostBack) {
// Validate initially to force the asterisks
// to appear before the first roundtrip.
Validate();
}
}
[C++] C++ のサンプルはありません。Visual Basic、C#、および JScript のサンプルを表示するには、このページの左上隅にある言語のフィルタ ボタン をクリックします。
必要条件
プラットフォーム: Windows 2000, Windows XP Professional, Windows Server 2003 ファミリ