Monday, October 25, 2010

DataList and ViewState

It could be either intended or an issue of ASP.NET, but the bottom line is the ViewState is not available for DataList control! Therefore, page after posting back will find datalist lost its viewstate. The solution is:
  1. save controls' status into session. (controls here is the controls inside datalist control)
  2. using OnItemDataBound(...) function to reload status info from session

No comments: