Order of calling of CreateChildControls() and ApplyChanges() methods in a SharePoint web part -


I am creating a web part for SharePoint, I have a custom editor part that is synchronized with SyncChange () and Upper Change ) Is overriding the methods (among others).

The problem is that when I right click in editing mode, the page changes to browse mode, but the data (propake) that was changed to EditorPart and saved in the ApplyChanges () method Is not updated.

I debug it and found out what it was doing - after right clicking in the edit mode, webpart .creativechildcontrols () is called first, and EditorPart.ApplyChanges () second. Therefore, the data was updated but it was non-updated data that was displayed.

I thought more about this behavior: adding a specific control to my webpart in CreateBildControls () causes the wrong sequence of calling the WebPort. CreateChildControls () and EditorPart.ApplyChanges () In my case it connects to WebDatry or ultra webbetry control (infographic), but it can also happen with the common ASP.NET textbox (as the same problem is explained here in detail :)

So if I add trees, CreateChildControls () is called First and ApplyChanges II, so it's not real. I have to refresh to see the changes made in the editor part.

If I add tree to the control archive, ApplyChanges is called first and everything is fine (except I need that tree :)). ..

Do anyone know why this strange behavior can happen?

Order calling methods and evetns is this: CreateChildControls ApplyChanges OnPreRender

If you use properties in CreateChildControls, they are not current, so I transferred the code that uses Web site properties from CreateChildControls to OnPreRender and all this works properly.


Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -