Thank you for reply!
I used your solution and i got value of a field in document type but i have a problem.
My code in webpart A:
var tr = new TreeProvider();
var xxxGuid = new Guid("ac6f95f3-7275-481c-a5ef-045c7bd0d02b");
var xxx= PageInfoProvider.GetPageInfo(xxxGuid);
var doc = DocumentHelper.GetDocument(xxx.DocumentID, tr);
var editContentValue = CMS.GlobalHelper.ValidationHelper.GetString(doc.GetValue("EditContent"), string.Empty);
var currentPage = PageInfoProvider.GetPageInfo(CMSContext.CurrentSiteName, string.Empty, CMSContext.CurrentDocumentCulture.CultureCode, string.Empty, CMSContext.CurrentPageInfo.NodeID, true);
currentPage.EditableRegions[yyy.ID.ToLower()] = CMS.GlobalHelper.ValidationHelper.GetString(editContentValue, string.Empty);
currentPage.EditableRegions[zzz.ID.ToLower()] = CMS.GlobalHelper.ValidationHelper.GetString(Constants.zzzTitle, string.Empty);
TreeNode tn = tr.SelectSingleNode(CMSContext.CurrentDocument.DocumentID);
// Update the content XML
tn.SetValue("DocumentContent", currentPage.DocumentContent);
// Update the document
tn.Update();
When I drag a webpart to old page,i work correct.But when create a new page then drag this webpart, i got a error "Object reference not set to an instance of an object." in line tn.SetValue("DocumentContent", currentPage.DocumentContent);
Please help me resolve this problem!