I'm doing a sort of migration of data from Documents on an older version of Kentico to version 8.1. On the older version of Kentico the content is stored as a Column on the Document Type and in the newer version of Kentico the content is just being thrown in an editable webpart on the Page itself.
The issue I ran into was that I found that if the document had content in let's say an editable webpart with the ID of content
the actual key for that editable webpart in that Dictionary was something like content-<id>
so I solved that by looking at all the keys and doing a partial string match to find the most appropriate match. However, the behavior is different if you try and access an Editable webpart on a newly created Page that hasn't had content saved in it. You can't find it in the EditableWebParts.Keys
dictionary, since it's empty (if none of the editable webparts on the page have any content assocaited with them).
What I found though, was if this is the state of the Page and you just do the following it works:
pageInfo.EditableWebParts["content"] = content;
it let's you assign the content without issue. I'm not sure if this is a bug or done on purpose and there is a better way to handle this (another series of libraries I should be using to access these EditableWebparts).
Thanks for the response, I'll take a look at your code and see if it makes more sense to take your approach moving forward.