Not sure why, but when I run the following code
HtmlAnchor bestellenLink = (HtmlAnchor)e.Item.FindControl("bestellenLink");
var uriBuilder = new UriBuilder(Request.Url.AbsoluteUri);
var paramValues = HttpUtility.ParseQueryString(uriBuilder.Query);
paramValues.Add("Test", HttpUtility.UrlEncode("ä"));
uriBuilder.Query = paramValues.ToString();
bestellenLink.HRef = uriBuilder.Uri.ToString();
I get the following output in the bestellenLink.HRef
:
http://somedomain/somepage.aspx?Test=%25c3%25a4
While the correct URL encoding of "ä" should be %c3%a4
and not %25c3%25a4
.
What am I doing wrong?
Thanks, /Francesco