Solved

Generate Multi parameter URL  in C# WPF

Posted on 2014-02-15
1
325 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&amp;ukey_id=3332

the '&' become &amp;

how do I encoding this string to work as a link?
thanks.
0
Comment
Question by:moshik008
1 Comment
 
LVL 82

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

746 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now