02-18-06 03:50 AM
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(Bool
ean
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.OnPlaceholderPro
pertyChanging(Placeholder
target, String propertyName, Object& propertyValue)
at
Microsoft.ContentManagement.Publishing.Placeholder.BeginWrite(String
propertyName, Object& propertyValue)
at
Microsoft.ContentManagement.Publishing.Extensions.Placeholders.XmlPlaceholde
r.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()
[ Post a follow-up to this message ]
|