Page.IsPostBack Property
.NET Framework 3.0
Gets a value indicating whether the page is being loaded in response to a client postback, or if it is being loaded and accessed for the first time.
Namespace: System.Web.UI
Assembly: System.Web (in system.web.dll)
Assembly: System.Web (in system.web.dll)
The following code example tests the value of the IsPostBack property to conditionally call the Page.Validate method for all validation server controls when the Page is loaded.
void Page_Load()
{
if (!(this.get_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(); } }
Community Additions
ADD
Show: