Views.GetViewHtml - Méthode
Renvoie le schéma complet de la vue spécifiée pour la liste spécifiée, y compris les sections de code HTML.
Espace de noms : WebSvcviews
Assembly : STSSOAP (dans STSSOAP.dll)
Syntaxe
'Déclaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetViewHtml", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/", _
ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetViewHtml ( _
listName As String, _
viewName As String _
) As XmlNode
'Utilisation
Dim instance As Views
Dim listName As String
Dim viewName As String
Dim returnValue As XmlNode
returnValue = instance.GetViewHtml(listName, _
viewName)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetViewHtml", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public XmlNode GetViewHtml(
string listName,
string viewName
)
Paramètres
listName
Type : System.StringChaîne qui contient le nom de la liste.
viewName
Type : System.StringChaîne qui contient le GUID qui spécifie l'affichage.
Valeur renvoyée
Type : System.Xml.XmlNode
Un fragment de Collaborative Application Markup Language (CAML) sous la forme suivante qui contient le schéma de vue et peut être affectée à un objet System.Xml.XmlNode .
<GetViewHTMLResult>
<View Name="{C1036607-EC8A-11d3-82AA-0050048394B0}" DefaultView="TRUE"
Type="HTML" DisplayName="All Contacts" Url="Lists/Contacts/AllItems.htm"
BaseViewID="1" >
<ViewHeader>
...
</ViewHeader>
<ViewBody>
...
</ViewBody>
<ViewFooter>
...
</ViewFooter>
<GroupByHeader>
...
</GroupByHeader>
<GroupByFooter>
...
</GroupByFooter>
<PagedRowset>
...
</PagedRowset>
<PagedRecurrenceRowset>
...
</PagedRecurrenceRowset>
<ViewEmpty>
...
</ViewEmpty>
<ViewBidiHeader>
...
</ViewBidiHeader>
<Toolbar Type="Standard">
...
</Toolbar>
<ViewFields>
<FieldRef Name="LinkTitle" />
<FieldRef Name="FirstName" />
<FieldRef Name="Company" />
<FieldRef Name="WorkPhone" />
<FieldRef Name="HomePhone" />
<FieldRef Name="Email" />
</ViewFields>
<Query>
<OrderBy>
<FieldRef Name="Title" />
<FieldRef Name="FirstName" />
</OrderBy>
</Query>
<Aggregations>
<FieldRef Name=”Column1” Type=”Minimum”>
</Aggregations>
<RowLimit Paged="TRUE">100</RowLimit>
</View>
</GetViewHTMLResult>
Exemples
L'exemple de code suivant utilise la méthode GetViewHtml pour afficher le schéma complet d'un affichage d'une liste spécifiée. Cet exemple suppose qu'un using (C#) ou la directive Imports (Microsoft Visual Basic) être inclus dans l'espace de noms System.Xml .
Dim viewService As New Web_Reference_Folder.Views()
viewService.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim node As XmlNode = viewService.GetViewHtml("List_Name", "71bb8975-c59f-4218-a045-eab56b41e666")
MessageBox.Show(node.OuterXml)
Web_Reference_Folder.Views viewService = new Web_Reference_Folder.Views();
viewService.Credentials= System.Net.CredentialCache.DefaultCredentials;
XmlNode node = viewService.GetViewHtml("List_Name", "71bb8975-c59f-4218-a045-eab56b41e666");
MessageBox.Show(node.OuterXml);