Previous Article <asp. NET Dynamic Loading Control> mentioned the control time loading and registration time, And the PostBack problem. in addition to the above two problems, the Control ID problem is easily overlooked.
In a Dynamically Loaded control, several more dynamically added buttons need to be clicked twice to trigger the event. However, if you add these dynamically added buttons directly to the page rather than the control, then everything is normal and very depressing. after hard work, I found that it would be normal to assign values to the ID attribute of the dynamically added button. If no value is assigned to the ID, Asp. net will automatically assign an ID to the control. Different ID values may be assigned during two PostBack operations. This causes the event to be triggered only when two buttons are specified. therefore, we should not be lazy when doing dynamic controls. We must specify a value for the ID. Otherwise, such hidden errors will actually be tortured. 87d9a686