2014-01-29 2 views
0

저는 C#을 사용하여 셰어 포인트 웹 사이트의 목록 항목을 프로그래밍 방식으로 업데이트하려고했습니다. WebServerReference을 성공적으로 수행 할 수있었습니다. 그러나 나는 다음과 같은 항목이 무엇인지 이해가 안 :목록 항목을 업데이트하는 방법?

ListId, viewId , FieldName ID 등 내가 내 값이 ListId, viewId , FieldName ID 값을 대체하기로하고 here 에서했다 다음 코드 조각에서

. 나는 그 가치를 얻을 수있는 곳이 없다. 나는 셰어 포인트 웹 사이트를 면밀히 조사해 왔지만 어디서나이 가치를 발견 할 수 없었다. 목록 설정 페이지에

/*Get Name attribute values (GUIDs) for list and view. */ 
System.Xml.XmlNode ndListView = listService.GetListAndView("MyList", ""); 
string strListID = ndListView.ChildNodes[0].Attributes["Name"].Value; 
string strViewID = ndListView.ChildNodes[1].Attributes["Name"].Value; 

/*Create an XmlDocument object and construct a Batch element and its 
attributes. Note that an empty ViewName parameter causes the method to use the default view. */ 
System.Xml.XmlDocument doc = new System.Xml.XmlDocument(); 
System.Xml.XmlElement batchElement = doc.CreateElement("Batch"); 
batchElement.SetAttribute("OnError", "Continue"); 
batchElement.SetAttribute("ListVersion", "1"); 
batchElement.SetAttribute("ViewName", strViewID); 

/*Specify methods for the batch post using CAML. To update or delete, 
specify the ID of the item, and to update or add, specify 
the value to place in the specified column.*/ 
batchElement.InnerXml = "<Method ID='1' Cmd='Update'>" + 
    "<Field Name='ID'>6</Field>" + 
    "<Field Name='Title'>Modified sixth item</Field></Method>" + 
    "<Method ID='2' Cmd='Update'><Field Name='ID'>7</Field>" + 
    "<Field Name='Title'>Modified seventh item</Field></Method>" + 
    "<Method ID='3' Cmd='Delete'><Field Name='ID'>5</Field>" + 
    "</Method><Method ID='4' Cmd='New'>" + 
    "<Field Name='Title'>Added item</Field></Method>"; 
+0

GUID를 사용하지 않으려면 목록의 표시 이름을 목록 ID로 사용할 수 있습니다 –

답변

1

시도 브라우징은 URL에서 목록의 ID를 얻을 URL에서보기 ID를 가져보기 페이지를 수정하고 목록 설정 페이지는 다음 필드를 얻을 수있는 필드를 클릭합니다 URL에서 이름. 또는이 정보를 쉽게 찾으려면 Codeplex에서 SharePoint Manager와 같은 도구를 사용해보십시오.

관련 문제