Try our conversational search powered by Generative AI!

does xhtmlstring property add p tags

Vote:
 

I have a page(page1) with property

public virtual XhtmlString DescriptionText { get; set; }

I am rendering the above value onto the other page. But the text is rendered within html p tags

If I have given the input as "This is test" on page1, when I try to render on page2, it is appearing as "

This is test>/p>"

I don't know where the p tags are coming from. I want the output on page2 the same text as page1.

#149523
Jun 02, 2016 13:42
Vote:
 

text you will be getting back will contain <p> or <div>
Regards
/K

#149524
Jun 02, 2016 14:25
Vote:
 

So do we have have to use regex on page2 to prevent rendering <p> or <div> tags?

Or Is there any other way to get page1 xhtml property value onto page2 without <p> or <div> tags?

#149562
Jun 03, 2016 10:55
Vote:
 

with assumption its mvc, HTML.PropertyFor should work.

#149567
Jun 03, 2016 12:12
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.