I have an ASP.NET WebForms application. I set the page title based on the content from my database.
As this content is entered by the user, it can contain any characters, including those that can be interpreted as HTML markup. So I am HTML coding this content before setting the header.
But I see that this causes problems, creating too encrypted results:
<title>Hoigaard&#39;s Nordic Walking Tuesdays</title>
What is the correct way to safely encode text used to set a title tag?
source share