Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I have the following code:

XmlNode newItemRes = ceoList.GetListItems("Pages", null, getItem, ndViewFields, null, null, null);
XDocument d = XDocument.Load(new XmlNodeReader(newItemRes));
XNamespace ns = "#RowsetSchema";
string newItemId = (from x in d.Descendants(ns + "row")
                 orderby x.Attribute("ows_Created_x0020_Date")
                 select (string)x.Attribute("ows_ID")).First();

newFolderXml = String.Format(
                        @"<Batch OnError='Continue'>
                            <Method ID='1' Cmd='Update'>
                                <Field Name='ID'>" + newItemId + @"</Field>
                                <Field Name='PublishingPageContent'>{0}</Field>
                                <Field Name='Title'>{1}</Field>
                                <Field Name='TaxKeywordTaxHTField'>28;Friday Memo|938edce3-67fd-438e-9c45-f475ab846187</Field>
                            </Method>
                        </Batch>", 
                                 SPEncode.HtmlEncode(String.Format(htmlBase, title, quickLinks, newPageContent)),
                                 "Friday Memo for " + nextFriday.ToString("M/d/yyyy"));

xd = new XmlDocument();
xd.LoadXml(newFolderXml);
newItem = xd.DocumentElement;
createdItem = ceoList.UpdateListItems("Pages", newItem);

When I look at the value in newItemId it is the ID of the list item I need to update, but for some reason after I execute this code the page is not updated. Can anyone see what I am doing wrong here?

share|improve this question
add comment

1 Answer

Adding:

bool test = ceoList.CheckOutFile("http://sp-pubdev:88/" + newUrl, "false", "");

before the code above (I was using true fore the second parameter before) fixed this issue.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.