Solved

Generate Multi parameter URL  in C# WPF

Posted on 2014-02-15
1
349 Views
Last Modified: 2014-03-10
Hi,
i am trying to build URL string lik:
var Tag =
                    string.Format(@"<img src=""{0}?camp_id={1}&ukey_id={2}"" alt="" width=""0"" height=""0"" 
						   style=""width: 0px; height: 0px; border:0px;"" />",
                                           baseURL,campaignId,ukeyid);

Open in new window


the proble is that when i am dibuggin it the string looks good:
http://www.mydomain.com/somepage.aspx?camp_id=23&ukey_id=3332

but when i am embedding the string in a HTML page it turned into:
 http://www.mydomain.com/somepage.aspx?camp_id=23&ukey_id=3332

the '&' become &amp;

how do I encoding this string to work as a link?
thanks.
0
Comment
Question by:moshik008
[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
1 Comment
 
LVL 83

Accepted Solution

by:
Dave Baldwin earned 500 total points
ID: 39862211
That is the correct encoding and it should work just fine.  A single '&' is supposed to be encoded as '&amp;' and should always be 'automatically' decoded as a single '&'.

If you run your page thru the W3C HTML Validator, it will call a single '&' an error and recommend that you replace it with '&amp;' which is the HTML Entities version.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…

707 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