Model.Content should be of type IHtmlString when you have rich text content.
So one way to check would be:
var html = Model.Content.GetPropertyValue<IHtmlString>("bodyTextRichEditor");
if (html != null && !String.IsNullOrEmpty(html.ToString())
{
<div>@html</div>
}
Post the actual code you are using, then and the line that raises this exception. The code I posted definitely does work, so it must be something else in the context of what you are doing...
Umbraco 7.7.6: Check RTE if is null...
I tried some test but I'm not able to check if RTE has no value and it's null. This is my test:
Model.Content should be of type IHtmlString when you have rich text content.
So one way to check would be:
Not work
Exception Details: System.ArgumentNullException: Value cannot be null. Parameter name: child
Post the actual code you are using, then and the line that raises this exception. The code I posted definitely does work, so it must be something else in the context of what you are doing...
is working on a reply...