1

I am using MvcSiteMapProvider and have a link I am trying to include in my Mvc.sitemap that contains queries and it's causing the beloved

'=' is an unexpected token. The expected token is ';'

error. My question is how do I insert urls with the queries?

<mvcSiteMapNode title="Trust Login" featuredLinkLocation="BusinessBanking" mainNavDisplay="false"  targetFrame="_blank" url="https://www.birdseye.com/login/Login.jsp?APPNAME=2&CLIENT=0&SAMUser=Y&TYPE=33554433&REALMOID=06-0005cdda-b874-1210-b84b-0a3fac12902c&GUID=&SMAUTHREASON=0&METHOD=GET&SMAGENTNAME=zJHq58lqPjf0BKoJX0w61BXvXBLCcR9tuX9XjbuTZIhHMGjYANxxSXrmTozblmwF&TARGET=$SM$https%3a%2f%2fwww%2eaccount3000%2ecom%2fchemical%2f" />
EHaltom
  • 147
  • 10

1 Answers1

1

As with any data you put into XML, you must escape your string. Namely, & is not a valid character in XML, and should be replaced with &amp;.

<mvcSiteMapNode title="Trust Login" featuredLinkLocation="BusinessBanking" 
    mainNavDisplay="false"  targetFrame="_blank" 
    url="https://www.birdseye.com/login/Login.jsp?APPNAME=2&amp;CLIENT=0&amp;SAMUser=Y&amp;TYPE=33554433&amp;REALMOID=06-0005cdda-b874-1210-b84b-0a3fac12902c&amp;GUID=&amp;SMAUTHREASON=0&amp;METHOD=GET&amp;SMAGENTNAME=zJHq58lqPjf0BKoJX0w61BXvXBLCcR9tuX9XjbuTZIhHMGjYANxxSXrmTozblmwF&amp;TARGET=$SM$https%3a%2f%2fwww%2eaccount3000%2ecom%2fchemical%2f" />

NOTE: I didn't run this - there may be other characters in your string that require XML escaping as well. If you want to avoid the XML escaping issue altogether, consider using a dynamic node provider for these nodes instead of XML configuration.

Community
  • 1
  • 1
NightOwl888
  • 55,572
  • 24
  • 139
  • 212