UserControl.IsPostBack Property
.NET Framework 3.0
Gets a value indicating whether the user control 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 example adds two key value pairs to the application state associated with a user control if the user control's IsPostBack property returns false. When this condition is met, the code uses the Add method, through the user control's Application property, to add the keys and their values.
if (!myControl.get_IsPostBack()) {
// Add new objects to the HttpApplicationState.
// These will be maintained as long as the application is active.
myControl.get_Application().Add("Author","Shafeeque");
myControl.get_Application().Add("Date",new DateTime(2001,6,21));
Community Additions
ADD
Show: