How to override Sitecore RichText field -


i want create custom field sitecore project inherits sitecore rich text field (sitecore.shell.applications.contenteditor.richtext). field read-only field , want code run when field loaded/displayed , need override value. seeing code run. when view content item in sitecore nothing displayed in rich text field. if click show editor button or edit html button view html, html content there. , if close little sitecore pop-up , go content item can see html. problem doesn't display first time come screen. feeling not overriding correct method of base control. here code

public class mycustomfield : sitecore.shell.applications.contenteditor.richtext {   protected override void onload(eventargs e)   {     ...insert custom code here build html string...     base.value = _myhtml;     base.onload(e);   } } 

i figured out. overriding wrong method. once switched override onprerender method worked fine. code should this:

public class mycustomfield : sitecore.shell.applications.contenteditor.richtext {   protected override void onprerender(eventargs e)   {     ...insert custom code here build html string...     this.value = _myhtml;     base.onprerender(e);   } } 

Comments

Popular posts from this blog

java - JavaFX 2 slider labelFormatter not being used -

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -