This topic has not yet been rated - Rate this topic

Forms.GetForm Method

Windows SharePoint Services 3
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("http://schemas.microsoft.com/sharepoint/soap/GetForm", RequestNamespace="http://schemas.microsoft.com/sharepoint/soap/", ResponseNamespace="http://schemas.microsoft.com/sharepoint/soap/", Use=SoapBindingUse.Literal, ParameterStyle=SoapParameterStyle.Wrapped)] 
public XmlNode GetForm (
	string listName,
	string formUrl
)

Parameters

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="http://schemas.microsoft.com/sharepoint/soap/" />

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.

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);
Did you find this helpful?
(1500 characters remaining)
Community Content Add
Annotations FAQ