Solved

Generate Multi parameter URL  in C# WPF

Posted on 2014-02-15
1
335 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 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

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Suggested Solutions

A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

772 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