I have a code that query an alias item like this Sitecore.Context.Database.SelectSingleItem("/page-help") but I get an error saying

End of string expected at position 42.

it only throws this error in my content management but not in my content delivery. How can I fix this in my content management?


1 Answer 1


You need to escape the - dashes.

Sitecore.Context.Database.SelectSingleItem("/page#-#help") alternatively Sitecore.Context.Database.SelectSingleItem("/#page-help#")


For simple queries like this however, the following would be eaiser


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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