?
Solved

Generate Multi parameter URL  in C# WPF

Posted on 2014-02-15
1
Medium Priority
?
358 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 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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

770 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