Last post Feb 03, 2021 10:20 AM by JamieP1
Jan 26, 2021 05:45 PM|JamieP1|LINK
Will give a small description of a problem i am facing but more information can be provided if required.
My database is saving text from a HTML editor as below
I output this data on a webpage using the below Decoding
txtDetails.Text = Server.HtmlDecode(o.Details);
The webpage itself looks fine when viewing in any browser. I see the text
Hi and thats it.
I now search google for this product. The title is fine however the text that appears below the blue google text is displaying
So it displays a p> before the text Hi.
Jan 27, 2021 05:23 AM|KathyW|LINK
"The webpage itself looks fine when viewing in any browser. I see the text
Hi and thats it."
What does the HTML code for that page look like near that output? View the page source and see.
Jan 27, 2021 07:17 AM|Sean Fang|LINK
The encoding works well from database to webpages as '<p>Hi </p>' to '<p>Hi</p>'.
Actually, the text is rendered as a html format in a html page but it does not mean the wrapper '<p></p>' disappears.
'<', '>' are common special characters. If you fetch the value directly from the page as a html formatted text, you will probably meet an encoding problem.
Could you please tell me how you use google to search for this product (as a string 'Hi')?
If you are using a HttpWebRequest and append the 'product' as a query string, you might need to encode the text again using
URL-encodes a string and returns the encoded string.
Feb 03, 2021 10:20 AM|JamieP1|LINK
Due to time constraints, i used a Regex query to strip the text from any formatting which seems to have resolved the issue for now.
I can post the code should anyone require.
Thanks for your help anyway.