Logo 
Search:

Sharepoint Forum

Ask Question   UnAnswered
Home » Forum » Sharepoint       RSS Feeds

Unable to cast object of type SPFieldText to type HtmlField

  Asked By: Aiesha    Date: May 17    Category: Sharepoint    Views: 4989

I'm trying to create my own content type to use in page layouts

When I use the tag:

<PublishingWebControls:RichHtmlField FieldName="MainContent1"
runat="server" id="RichHtmlField1">

</PublishingWebControls:RichHtmlField >

I keep getting this error:

Unable to cast object of type 'Microsoft.SharePoint.SPFieldText' to type
Microsoft.SharePoint.Publishing.Fields.HtmlField'

The page renders correctly when I change the tag to:

<radE:RadHtmlField FieldName=" MainContent1" runat="server"
id="RichHtmlField1">

</radE:RadHtmlField>

(enables rich text editor for Mac)

I've specified the Field type as HTML

<Field ID="{B029886A-F860-4d5d-9EA2-000000000022}"

Name="BYUIWebContent1"

StaticName="BYUIWebContent1"

SourceID="http://schemas.microsoft.com/sharepoint/"

Group="BYUI Web Columns"

DisplayName="MainContent1"

Type="HTML"

Required="False"

Sealed="FALSE"

RichText="TRUE"

RichTextMode="FullHtml"></Field>

The content type contains this field ref:

<FieldRef ID="{B029886A-F860-4d5d-9EA2-000000000022}" Name="WebContent1"
Hidden="FALSE" />

Any Ideas?

Share: 

 

No Answers Found. Be the First, To Post Answer.

 




Tagged: