How to enforce "&"inside my queryString?

M

Mehdi

Hi,

I need to pass an URL via a hidden value as follow:

<input type="hidden" id="Test" runat="Server">

and on Page_Load I assign a value to this hidden input as follow:

Test.Value = "http://www.myserver.com?id=123&name=HomerSimpson";


However when I view the page source "&" is replaced with "&amp;" as the URL
changes to http://www.myserver.com?id=123&amp;name=HomerSimpson

How can I enforce the "&" inside my querystring when written into HTML?

I have tried to Server.UrlEncode, but the server that I am posting this
hidden value to, does not decode it before returning to the URL, and
unfortuntely I have no control over the way that they handle my hidden value
(URL with &amp;)

Thanks for your time.


Mehdi
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top