Original question: if (! Page.ispostback) {.... this.dropdownlist1.datasource = this.sqlcommand1.executeReader (); this.dropdownlist1.database.Database
How do you execute a DataBind in Postback? Oh, tossing for a day.
In this case, it will not be able to get the value of DropDownList changes, because each postback is re-databind, and the value is restored?
Reply:
IF (! page.ispostback)
{
....
THIS.DROPDOWNLIST1.DATASOURCE = this.sqlcommand1.executeReader ();
This.dropdownList1.Database (); // The code here does not execute when postback
}
If you happen to see if the Vale value of all items is the same, DropDownload only saves the Vale value in ViewState and decides the option after Postback.