This documentation is archived and is not being maintained.

Views.GetViewHtml Method

Windows SharePoint Services 3
Returns the full schema of the specified view for the specified list, including the HTML sections.

Web Service: ViewsWeb Reference: http://<Site>/_vti_bin/Views.asmx

[SoapDocumentMethodAttribute("", RequestNamespace="", ResponseNamespace="", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] 
public XmlNode GetViewHtml (
	string listName,
	string viewName



A string that contains the name of the list.


A string that contains the GUID specifying the view.

Return Value

A fragment in Introduction to Collaborative Application Markup Language (CAML) in the following form that contains the view schema and can be assigned to a System.Xml.XmlNode object.
  <View Name="{C1036607-EC8A-11d3-82AA-0050048394B0}" DefaultView="TRUE" 
    Type="HTML" DisplayName="All Contacts" Url="Lists/Contacts/AllItems.htm" 
    BaseViewID="1" xmlns="">
    <Toolbar Type="Standard">
      <FieldRef Name="LinkTitle" /> 
      <FieldRef Name="FirstName" /> 
      <FieldRef Name="Company" /> 
      <FieldRef Name="WorkPhone" /> 
      <FieldRef Name="HomePhone" /> 
      <FieldRef Name="Email" /> 
        <FieldRef Name="Title" />
        <FieldRef Name="FirstName" />
      <FieldRef Name=”Column1” Type=”Minimum”>
    <RowLimit Paged="TRUE">100</RowLimit>

The following code example uses the GetViewHtml method to display the full schema of a specified view for a specified list. This example requires that a using (C#) or Imports (Microsoft Visual Basic) directive be included for the System.Xml namespace.

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");