Michael Hamrah
10/29/2006 6:39:00 PM
I think the problem you have is that you're not loading the contents of
the control tree properly. I don't think .NET can find the Textbox
control when a Postback happens so it can't properly set the textbox
text property. This is because you're only adding the textbox in the
PreRender event if the user is in edit mode.
You want to sure ensure that all controls sent to the client are loaded
again in the init event during a postback. THis allow .NET to properly
map form objects to .NET controls. You can try either 1) Always
loading the textbox but setting the visible property to true or false,
2) Add a marker that will tell the control to load the Textbox in the
Init event if it was sent out during the Init event. 3) Explicitly
setting the text property of the Textbox by implementing the
IPostBackDataHandler interface.