Share via


Forms.GetFormCollection Method

Returns the URLs and types of the forms for a list.

Web Service: FormsWeb Reference: http://<Site>/_vti_bin/Forms.asmx

Syntax

<SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/GetFormCollection", RequestNamespace:="http://schemas.microsoft.com/sharepoint/soap/", ResponseNamespace:="http://schemas.microsoft.com/sharepoint/soap/", Use:=SoapBindingUse.Literal, ParameterStyle:=SoapParameterStyle.Wrapped)> _
Public Function GetFormCollection ( _
    listName As String _
) As XmlNode

Dim instance As Forms
Dim listName As String
Dim returnValue As XmlNode

returnValue = instance.GetFormCollection(listName)
[SoapDocumentMethodAttribute("http://schemas.microsoft.com/sharepoint/soap/GetFormCollection", RequestNamespace="http://schemas.microsoft.com/sharepoint/soap/", ResponseNamespace="http://schemas.microsoft.com/sharepoint/soap/", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] 
public XmlNode GetFormCollection (
    string listName
)

Parameters

  • listName
    String that contains the internal name of the list.

Return Value

An XML fragment in the following form that contains the URL and type for the form, and that can be assigned to a System.Xml.XmlNode object.

<Forms xmlns="http://schemas.microsoft.com/sharepoint/soap/">
   <Form Url="Lists/List_Name/DispForm.aspx" Type="DisplayForm" />
   <Form Url="Lists/List_Name/EditForm.aspx" Type="EditForm" />
   <Form Url="Lists/List_Name/NewForm.aspx" Type="NewForm" />
</Forms>

Example

The following code example displays the URLs and types of the forms for a list.

This example requires that a using (Visual C#) or Imports (Visual Basic) directive be included for the System.Xml namespace.

Dim formService As New Web_Reference_Folder_Name.Forms()
formService.Credentials = System.Net.CredentialCache.DefaultCredentials

Dim ndForms As XmlNode = formService.GetFormCollection("List_Name")

MessageBox.Show(ndForms.OuterXml)
Web_Reference_Folder_Name.Forms formService = 
    new Web_Reference_Folder_Name.Forms();
formService.Credentials= System.Net.CredentialCache.DefaultCredentials;

XmlNode ndForms = formService.GetFormCollection("List_Name");

MessageBox.Show(ndForms.OuterXml);

See Also

Reference

Forms Class
Forms Members
Forms Web Service