Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

CompositeField Default Template

  Asked By: Tapasvi    Date: Jan 01    Category: Sharepoint    Views: 2216

I can't get SharePoint:CompositeField to use an alternate
RenderingTemplate

The default control for SharePoint:CompositeField exists in
DefaultTemplates.ascx

I took an exact copy of this template and called it
BYUICompositeTemplate

<SharePoint:RenderingTemplate ID="BYUICompositeField" runat="server">

There is a line of code in userdisp.aspx:

<SharePoint:CompositeField FieldName="Name" ControlMode="Display"
runat="server"/>

I try to change the default template by using the Template attribute:

<SharePoint:CompositeField FieldName="Name"
Template="BYUICompositeField" ControlMode="Display" runat="server"/>

I get the error:

Cannot create an object of type 'System.Web.UI.ITemplate' from its
string representation 'CompositeField' for the 'Template' property.

Any Ideas?

Share: 

 

1 Answer Found

 
Answer #1    Answered By: Omar Arnold     Answered On: Jan 01

The MSDN article had an error

msdn2.microsoft.com/en-us/library/aa544582.aspx

You have to use TemplateName and not Template.

msdn2.microsoft.com/.../...t.sharepoint.webcontrol
s.templatebasedcontrol.template.aspx

For those that haven't delved into developing .ascx RenderingTemplate(s)
I would highly recommend it as fundamental skill to know. I think I've
got my userdisp.aspx problem fixed and I can see how this will be useful
elsewhere too.

 
Didn't find what you were looking for? Find more on CompositeField Default Template Or get search suggestion and latest updates.