After you click the submit button, all the control values bound to the database on the page are restored to the default value.
The reason is to write the binding function loadData () in
If (! IsPostBack)
{
Your binding function;
}
Otherwise, the page is reloaded, and the values of all controls are changed to the initial values.
IsPostBack is an attribute of the bool type in the Page class. It is used to determine whether the current Page is being loaded or accessed for the first time in response to the return of the client.
When IsPostBack = true, it indicates loading in response to the client sending back.
When IsPostBack is set to false, it indicates that it is being loaded and accessed for the first time.
That is to say, only when IsPostBack = false is executed, bind the function, this will not cause page overloading, and lead to page control initialization.
IsPostBack introduction:
Http://msdn.microsoft.com/en-us/library/system.web.ui.page.ispostback.aspx
Http://www.cxy.me/doc/5446.htm