Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Dynamic property not saved

Vote:
 

I'm trying to create a generic control which adds property-controls based on the properties of a selected type. When the user selects the item-type and clicks 'Add', a new object of this type is added to the list.
Then the object is checked using reflection and the necessary property-controls are added (using CreateEditControls) and set up (using SetupControl). This part works fine.

The problem is when the user then fill in a value and clicks 'Save'. During the postback, the list (stored in the control-state) is loaded and the controls are re-created and set up again. Then the 'ApplyEditChanges' is called to save the values from the controls back to the list. Unfortunately, the control has no value!
When the user re-opens the page, the right controls are shown, but they're empty. When the user now enters a value and clicks 'Save', the control DOES have the value and saves correctly.

What is causing this behaviour?

I also tried without the control-state, but then adding the control didn't even work and it seems like the default value is loaded every time and I'm unable to update it.

#63271
Nov 13, 2012 18:18
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.