Microsoft Content Management Server - XmlPlaceholder ReadOnly

This is Interesting: Free IT Magazines  
Home > Archive > Microsoft Content Management Server > February 2006 > XmlPlaceholder ReadOnly





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author XmlPlaceholder ReadOnly
Charly

2006-02-17, 10:50 pm

Trying to write to XmlPlaceholder, (XmlAsString property) using the
code below
(dLinks is XmlDocument,
cHC is CmsHttpContext):

if (P.State == PostingState.New)
{
Template LLTemp = (Template)cHC.Searches.GetByGuid(
HsConst.LINKLISTGUID);
Channel Chan = cHC.Channel;
P = Chan.CreatePosting(LLTemp);
}
XmlPlaceholder phLinks = HLL.Posting.Placeholders["Links"] as
XmlPlaceholder;
if (phLinks != null)
phLinks.XmlAsString = dLinks.OuterXml; // ************* Error
HERE
cHC.CommitAll();

and I get this error on the line indicated above. ANy ideas ???

Microsoft.ContentManagement.Publishing.CmsInvalidObjectStateException:
Cannot modify read only object. The target object is read only and it
cannot be modified. ---> System.Runtime.InteropServices.COMException
(0x80041BD6): Cannot modify read only object. The target object is
read only and it cannot be modified.
at
Microsoft.ContentManagement.Interop.Publishing.IRcwPosting.__BeginWrite(Boolean
ignoreMarkedForActions)
at Microsoft.ContentManagement.Publishing.Posting.BeginWrite(Boolean
ignoreMarkForActions)
--- End of inner exception stack trace ---
at Microsoft.ContentManagement.Publishing.Posting.BeginWrite(Boolean
ignoreMarkForActions)
at Microsoft.ContentManagement.Publishing.Posting.BeginWrite()
at
Microsoft.ContentManagement.Publishing.Events.PostingEvents. OnPlaceholderPropertyChanging(Placeholde
r
target, String propertyName, Object& propertyValue)
at
Microsoft.ContentManagement.Publishing.Placeholder.BeginWrite(String
propertyName, Object& propertyValue)
at
Microsoft.ContentManagement.Publishing.Extensions.Placeholders.XmlPlaceholder.set_XmlAsString(String
value)
at Vss.HS.Sys.CMS.Templates.LinkList.SaveLinksData() in
d:\websites\hscms\templates\linklist.aspx.cs:line 297
at Vss.HS.Sys.CMS.Templates.LinkList.SaveData() in
d:\websites\hscms\templates\linklist.aspx.cs:line 278
at Vss.HS.Sys.CMS.Templates.LinkList.Save() in
d:\websites\hscms\templates\linklist.aspx.cs:line 233
at Vss.HS.Sys.CMS.Templates.LinkList.Page_Load(Object sender,
EventArgs e) in d:\websites\hscms\templates\linklist.aspx.cs:line 103
at System.EventHandler.Invoke(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain()

Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com