Adding classes to item.GetPropertyValue() auto-generated p elements
It seems whenever I call the GetPropertyValue() function, a p elements is automatically generated, meaning I can't wrap my call in my own implemented p element. I need to add a few classes to this element, but I am unable to, as the auto generated element is only created at runtime.
This is my call:
@(item.GetPropertyValue("desscription"))
When i wrap this in a p element with a class like this:
If your description field is a rich-text editor then it will return your content as HTML, including paragraph tags, headings etc.. So you don't want to wrap rich-text content in P tags. Use a div or something else more semantically suited.
If you want just plain text, then use a textbox or textarea instead of the rich-text editor.
Adding classes to item.GetPropertyValue() auto-generated p elements
It seems whenever I call the GetPropertyValue() function, a p elements is automatically generated, meaning I can't wrap my call in my own implemented p element. I need to add a few classes to this element, but I am unable to, as the auto generated element is only created at runtime.
This is my call:
@(item.GetPropertyValue("desscription"))
When i wrap this in a p element with a class like this:
The browser adds an empty p element, as well as a p element containing a span with my property string.
How do I add classes and data-types to p elements containing my property values?
If your description field is a rich-text editor then it will return your content as HTML, including paragraph tags, headings etc.. So you don't want to wrap rich-text content in
P
tags. Use a div or something else more semantically suited.If you want just plain text, then use a textbox or textarea instead of the rich-text editor.
is working on a reply...