Solved

Ampersand character in SiteMapNode string

Posted on 2009-03-30
9
1,083 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
Create the perfect environment for any meeting

You might have a modern environment with all sorts of high-tech equipment, but what makes it worthwhile is how you seamlessly bring together the presentation with audio, video and lighting. The ATEN Control System provides integrated control and system automation.

 

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 250 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

Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

Question has a verified solution.

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

Suggested Solutions

Google Forms is a great platform to easily create polls, questionnaires and surveys. The service allows you to receive data in real-time and is a simple way to conduct large-scale surveys that can be distributed to multiple people.   The platform …
Meet the world's only “Transparent Cloud™” from Superb Internet Corporation. Now, you can experience firsthand a cloud platform that consistently outperforms Amazon Web Services (AWS), IBM’s Softlayer, and Microsoft’s Azure when it comes to CPU and …
This Micro Tutorial demonstrates in Google Analytics how to create a custom report that shows you traffic over time using the month of year dimensions. There are also instructions on how to fix Google's odd month of year formatting, which Microsoft …
This Micro Tutorial demonstrates how to create custom reports and the secrets of determine the metrics and dimensions for your data that works best with your needs.

738 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