获取一个值,该值指示该页是否正为响应客户端回发而加载,或者它是否正被首次加载和访问。
命名空间:System.Web.UI
程序集:System.Web(在 system.web.dll 中)
Public ReadOnly Property IsPostBack As Boolean
Dim instance As Page
Dim value As Boolean
value = instance.IsPostBack
public bool IsPostBack { get; }
public:
property bool IsPostBack {
bool get ();
}
/** @property */
public boolean get_IsPostBack ()
public function get IsPostBack () : boolean
属性值
如果是为响应客户端回发而加载该页,则为 true;否则为 false。
下面的代码示例测试 IsPostBack 属性的值以在加载了 Page 时按条件为所有验证服务器控件调用 Page.Validate 方法。
Sub Page_Load
If Not IsPostBack
' Validate initially to force the asterisks
' to appear before the first roundtrip.
Validate()
End If
End Sub
void Page_Load() {
if (!IsPostBack) {
// Validate initially to force asterisks
// to appear before the first roundtrip.
Validate();
}
}
function Page_Load() {
if (!IsPostBack) {
// Validate initially to force the asterisks
// to appear before the first roundtrip.
Validate();
}
}
Windows 98、Windows 2000 SP4、Windows Server 2003、Windows XP Media Center Edition、Windows XP Professional x64 Edition、Windows XP SP2、Windows XP Starter Edition
.NET Framework 并不是对每个平台的所有版本都提供支持。有关受支持版本的列表,请参见系统要求。
.NET Framework
受以下版本支持:2.0、1.1、1.0