Technorati Tags:
ViewState,
ASP.NET The ID Property is Important
I've encountered quite a few developers having ViewState problems with dynamic controls. Ever have a control get recreated, but the value isn't there on PostBack and you are creating your controls at the correct time? Frustrating to say the least. Anyway, even if you follow the correct pattern for creating / recreating dynamic controls, you may either forget (D'oh) or don't set (Double D'oh) an ID for the control. By not setting an ID, you are relying on ASP.NET to create the control with the same ID. Sometimes it will, other times it won't... not a gamble you should take. More...