Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Ampersand character in SiteMapNode string

Posted on 2009-03-30
9
Medium Priority
?
1,086 Views
Last Modified: 2014-11-12
Is it possible to have an entry in a sitemapnode stringan amerpsand as in

<siteMapNode url="http://www.foo.com/default.asp?src=foo.com&ctz=America/New_York" title="test"  roles="*" description="test" />

I seem to need this to reference a Google calendar within a menu.
0
Comment
Question by:steve_webber
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 5
  • 4
9 Comments
 
LVL 9

Expert Comment

by:cdaly33
ID: 24021593
Is it giving you an error?  If so, what's the error.  Usually you'd want to html escape any special characters in there so & becomes &amp;


<siteMapNode url="http://www.foo.com/default.asp?src=foo.com&amp;ctz=America/New_York" title="test"  roles="*" description="test" />

Open in new window

0
 

Author Comment

by:steve_webber
ID: 24021942
The message I get is

The 'url' property had a malformed URL: http://www.google.com/calendar/embed?src=pghsnc1hg8slhvnag0qo4rsilg%40group.calendar.google.com&ctz=America/New_York.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Configuration.ConfigurationErrorsException: The 'url' property had a malformed URL: http://www.google.com/calendar/embed?src=pghsnc1hg8slhvnag0qo4rsilg%40group.calendar.google.com&ctz=America/New_York.

I get the same error when I use "&amp;" instead of "&".

Is there some mode of Visual Studio where "&" characters are treated in some special way?
0
 
LVL 9

Expert Comment

by:cdaly33
ID: 24022165
Interesting.  Are you saying that you don't get the error when not including the ampersand? I know the url then won't get you to where you want to be but it would help to know if the error goes away without the ampersand.
0
RHCE - Red Hat OpenStack Prep Course

This course will provide in-depth training so that students who currently hold the EX200 & EX210 certifications can sit for the EX310 exam. Students will learn how to deploy & manage a full Red Hat environment with Ceph block storage, & integrate Ceph into other OpenStack service

 

Author Comment

by:steve_webber
ID: 24022216
The error does go away without the ampersand, but of course it doesn't work at the web site. If I cut and paste the exact string and place it in a browser, it works -- with the ampersand.
0
 
LVL 9

Expert Comment

by:cdaly33
ID: 24022277
From what this link says you should also be able to use the code #38; in place of the ampersand.
http://www.devcurry.com/2009/02/putting-ampersand-sign-in-sitemapnode.html
0
 

Author Comment

by:steve_webber
ID: 24022337
The #38 has the same problem. I tried changing the %40 that Google told me to put in. That is the culprit. Without that character, it gets by Visual Studio and ASP.NET, but, of course, fails at he Google site.
0
 
LVL 9

Accepted Solution

by:
cdaly33 earned 1000 total points
ID: 24022381
Last suggestion I have is doing the same as the bottom of this thread, remove all %'s by replacing with their real values.
http://forums.asp.net/p/1334915/2687072.aspx
0
 

Author Comment

by:steve_webber
ID: 24022439
What is the equivalent of %40?
0
 

Author Comment

by:steve_webber
ID: 24022499
The %40 is an @ sign. When I used that, all worked.
0

Featured Post

On Demand Webinar: Networking for the Cloud Era

Did you know SD-WANs can improve network connectivity? Check out this webinar to learn how an SD-WAN simplified, one-click tool can help you migrate and manage data in the cloud.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If your app took Google’s lash recently, here are the 5 most likely reasons.
Originally, this post was published on Monitis Blog, you can check it here . It goes without saying that technology has transformed society and the very nature of how we live, work, and communicate in ways that would’ve been incomprehensible 5 ye…
This Micro Tutorial will demonstrate how marketers can use the Mobile Emulation Tool in Chrome Developer Tool. This will let you preview your site on any mobile device.
This Micro Tutorial will demonstrate how to analyze your website's back links using a network graph powered by a fusion table.

722 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question