Forms.GetForm Method

Returns the schema of a form for a specified list based on the name of the list and the URL of the form.

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


<SoapDocumentMethodAttribute("", RequestNamespace:="", ResponseNamespace:="", Use:=SoapBindingUse.Literal, ParameterStyle:=SoapParameterStyle.Wrapped)> _
Public Function GetForm ( _
    listName As String, _
    formUrl As String _
) As XmlNode

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

returnValue = instance.GetForm(listName, formUrl)
[SoapDocumentMethodAttribute("", RequestNamespace="", ResponseNamespace="", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] 
public XmlNode GetForm (
    string listName,
    string formUrl


  • listName
    String that contains the internal name of the list.
  • formUrl
    String that contains the site-relative URL of the form to retrieve (for example, Lists/List_Name/NewForm.aspx).

Return Value

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

<Form Type="NewForm" Url="NewForm.aspx" WebPartZoneID="Main" 
   xmlns="" />


The following code example displays information about a specified form.

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 ndForm As XmlNode = formService.GetForm("List_Name", _

Web_Reference_Folder_Name.Forms formService = 
    new Web_Reference_Folder_Name.Forms();
formService.Credentials= System.Net.CredentialCache.DefaultCredentials;

XmlNode ndForm = formService.GetForm("List_Name",


See Also


Forms Class
Forms Members
Forms Web Service