You might be able to resolve this by writing out the entire value to an
<asp:Literal> control, e.g.
<asp:Literal id="TestLiteral" runat="Server">
TestLiteral.Text = String.Format (
@"<input type=""hidden"" value=""{0}"" id=""Test"" runat=""Server"">",
@"http://www.myserver.com?id=123&name=HomerSimpson"
);
"Mehdi" <nospam@nospam.nowhere> wrote in message
news:u7nHZVYBFHA.3708@TK2MSFTNGP14.phx.gbl...[color=blue]
> 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 "&" as the[/color]
URL[color=blue]
> changes to
http://www.myserver.com?id=123&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[/color]
value[color=blue]
> (URL with &)
>
> Thanks for your time.
>
>
> Mehdi
>
>
>
>
>[/color]