?
Solved

Generate Multi parameter URL  in C# WPF

Posted on 2014-02-15
1
Medium Priority
?
377 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
1 Comment
 
LVL 84

Accepted Solution

by:
Dave Baldwin earned 2000 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

Technology Partners: 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

The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
When cloud platforms entered the scene, users and companies jumped on board to take advantage of the many benefits, like the ability to work and connect with company information from various locations. What many didn't foresee was the increased risk…
Suggested Courses

850 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