ViewState and ItemCreated
I have a datalist which gets databound when !IsPostBack
A user may have edited some of the textboxes in it, so I want to get the updated values.
I do this with the OnItemCreated event by:
TextBox mybox = (TextBox)e.Item.FindControl("tbox_id");
Unfortunately, mybox.Text turns out to be empty, even though I have EnabledViewState on.
Subsequently, however, the textbox text is preserved (through the viewstate I presume), and shows up on the page, but this restoration of state seems to happen after the ItemCreated event.
Any ideas of how to get the state of controls from within the ItemCreated event?