Condividi tramite


SPMobileListFieldRendering.DefaultTemplateName Property

Gets the name of the <RenderingTemplate> that renders a field on a form or list view page.

Namespace:  Microsoft.SharePoint.MobileControls
Assembly:  Microsoft.SharePoint (in Microsoft.SharePoint.dll)

Syntax

'Declaration
Public Overrides ReadOnly Property DefaultTemplateName As String
    Get
'Usage
Dim instance As SPMobileListFieldRendering
Dim value As String

value = instance.DefaultTemplateName
public override string DefaultTemplateName { get; }

Property Value

Type: System.String
A String that represents the name of the <RenderingTemplate> that renders a field on a form or list view.

Remarks

For list view pages, this property returns "MobileListFieldViewRendering". For forms, it returns "MobileListFieldFormRendering".

As the following excerpt from MobileDefaultTemplates.ascx (located in %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\TEMPLATE\CONTROLTEMPLATES.) illustrates, the MobileListFieldViewRendering <RenderingTemplate> calls another <RenderingTemplate> that is named "MobileCompositeField". It, in turn, calls various other controls, the most critical of which is named “MobileListField”. The latter control calls a SPMobileListFieldSelector control to render the field on the list view. The latter control will itself call some other <RenderingTemplate>. See SPMobileCompositeField for details.

<SharePoint:RenderingTemplate RunAt="Server" id="MobileListFieldViewRendering">
  <Template>
    <SPMobile:SPMobileComponent RunAt="Server" 
       TemplateName="MobileCompositeField" />
  </Template>
</SharePoint:RenderingTemplate> 


<!-- matter omitted -->

<SharePoint:RenderingTemplate RunAt="Server" id="MobileCompositeField">
  <Template>
    <SPMobile:SPMobileControlContainer RunAt="Server">
      <SPMobile:SPMobileFieldLabel RunAt="Server" 
         StyleReference="MobileFieldLabelStyle" />
      <SPMobile:SPMobileComponent  RunAt="Server" 
         TemplateName="MobileListField" />
    </SPMobile:SPMobileControlContainer>
  </Template>
</SharePoint:RenderingTemplate>

<!-- matter omitted -->

<SharePoint:RenderingTemplate RunAt="Server" id="MobileListField">
  <Template>
    <SPMobile:SPMobileListFieldSelector RunAt="Server" />
  </Template>
</SharePoint:RenderingTemplate>

As the following excerpt illustrates, the MobileListFieldFormRendering <RenderingTemplate> calls a SPMobileCompositeField control to render the field on a form.

<SharePoint:RenderingTemplate RunAt="Server" 
    ID="MobileListFieldFormRendering">
    <Template>
  <SPMobile:SPMobileCompositeField RunAt="Server" />
  </Template>
</SharePoint:RenderingTemplate>

See Also

Reference

SPMobileListFieldRendering Class

SPMobileListFieldRendering Members

Microsoft.SharePoint.MobileControls Namespace

SPMobileCompositeField