Search code examples
sharepointsharepoint-2007sharepoint-designerhtml-encode

How to disable html encode in SharePointWebControls:FieldValue?


I'm building a publishing page to allow the user to add youtube video. I created a field to the user to put the youtube embed code so I can put it in a page template in SharePoint Designer. When I use SharePointWebControls:FieldValue it encodes the html of the field which contains the html embed code. How can I disable this encode feature in this field? I checked the MSDN but didn't find any property of the field to achieve this task? Can anyone help me in this issue?

Note: there is a solution of building (generate) the embed script myself (string concatenation) but I don't want to use it


Solution

  • Your best option is probably a custom field editor control - the out of box ones that support html tend to strip out object or video tags.

    You can't do this with SharePoint Designer alone, but if you can deploy code and just need to support SharePoint Designer for the users the code needed is fairly simple.