I am using WebMatrix (I’m like, addicted to it), for a new site (well, it’s just a new version of an existing site) and I have this:
_SiteLayout.cshtml:
@{
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>@Page.Title</title>
</head>
<body>@RenderBody()</body>
</html>
}
and…
Default.cshtml:
@{
Layout = "~/_SiteLayout.cshtml";
Page.Title = "SexyDomainManager®";
}
<p>Etc</p>
Which should make the title of the page look like this:
SexyDomainManager®
However, it doesn’t. Instead, you can actually see ® in the title. This only happens when I use @Page.Title. Why? And how do I fix this?
I don’t know “WebMatrix”, but it obviously HTML encodes the values before including them in the output, so that the developer (you) doesn’t need to, which is correct behavior for a web framework.
So if you what the title to contain “®” then write “®”: