Use the Page.IsPostBack property to ensure that you only
perform page initialization logic when a page is first loaded and not in response
to client postbacks. The following code fragment shows how to use the
Page.IsPostBack property.
Listing 8
if (!Page.IsPostBack) //IsPostBack property will be false for the first time
{
//load the dataset for the first time
}
else
{
//use the loaded dateset for other post back requests
}