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.
Namespace: [Forms Web service]
Web service reference: http://Site/_vti_bin/Forms.asmx
Syntax
'Declaration
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetForm", RequestNamespace := "https://schemas.microsoft.com/sharepoint/soap/", _
ResponseNamespace := "https://schemas.microsoft.com/sharepoint/soap/", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
Public Function GetForm ( _
listName As String, _
formUrl As String _
) As XmlNode
'Usage
Dim instance As Forms
Dim listName As String
Dim formUrl As String
Dim returnValue As XmlNode
returnValue = instance.GetForm(listName, _
formUrl)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sharepoint/soap/GetForm", RequestNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
ResponseNamespace = "https://schemas.microsoft.com/sharepoint/soap/",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
public XmlNode GetForm(
string listName,
string formUrl
)
Parameters
listName
Type: System.StringString that contains the internal name of the list.
formUrl
Type: System.StringString that contains the site-relative URL of the form to retrieve (for example, Lists/List_Name/NewForm.aspx).
Return Value
Type: System.Xml.XmlNode
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="https://schemas.microsoft.com/sharepoint/soap/" />
Examples
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", _
"Lists/List_Name/NewForm.aspx")
MessageBox.Show(ndForm.OuterXml)
Web_Reference_Folder_Name.Forms formService =
new Web_Reference_Folder_Name.Forms();
formService.Credentials= System.Net.CredentialCache.DefaultCredentials;
XmlNode ndForm = formService.GetForm("List_Name",
"Lists/List_Name/NewForm.aspx");
MessageBox.Show(ndForm.OuterXml);