Forms.GetFormCollection Method
Returns the URLs and types of the forms for a list.
Namespace: [Forms Web service]
Web service reference: http://Site/_vti_bin/Forms.asmx
Syntax
'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetFormCollection", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/", _
ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetFormCollection ( _
listName As String _
) As XmlNode
'Usage
Dim instance As Forms
Dim listName As String
Dim returnValue As XmlNode
returnValue = instance.GetFormCollection(listName)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetFormCollection", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public XmlNode GetFormCollection(
string listName
)
Parameters
listName
Type: System.StringString that contains the internal name of the list.
Return Value
Type: System.Xml.XmlNode
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="https://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>
Examples
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);