| |||||
Page.IsPostBack PropertySystem.Web.UI Namespace Page Class Returns 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. Syntax
Property ValueThis property returns only a boolean value: true if the page is being loaded in response to a client postback; otherwise, false. Default value is false. RemarksUse the IsPostBack property to test either of two states:
This property is typically used within a Page_Load event handler to conditionally execute one or more embedded statements, depending on the IsPostBack state when the page is loaded. ExampleThe following example evaluates IsPostBack on page load, and runs the embedded statements only if IsPostBack is not true, indicating the page is being accessed for the first time. protected void Page_Load ( Object Src, EventArgs E ) {
if ( !IsPostBack ) {
string query = "SELECT distinct Type FROM Products";
mySelect.DataSource = fetchData ( query, "gear" );
mySelect.DataBind ( );
}
}
See Also |
| ||||
Check out related books at Amazon
© 2000-2008 Rey Nuñez All rights reserved.
If you have any question, comment or suggestion
about this site, please send us a note
You can help support aspxtreme