1

There is review for SEO to include Schema.org for google search but when added the Json-LD tags as below

<script type='application/ld+json'>
{
    "@context": "http://www.schema.org"
}
</script>

with customized tag sitecore is throwing following 500 error

\Layouts\Default.cshtml(195): error CS0103: The name 'context' does not exist in the current context
Source: System.Web
   at System.Web.Compilation.AssemblyBuilder.Compile()

Could you please help how to include schema.org context ? or is there any approach to include in sitecore

0

@ is a reserved character in Razor views (.cshtml) files. It means that the following text should be interpreted as code.

Just escape @ character like that:

{ "@@context": "http://www.schema.org" }
1
  • Thanks @marek, it solved the issue and one of the key @@Type was missing @ , – Avinash J Feb 18 at 5:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.