I am working on an asp.net MVC web application. and i am building a URI to be sent to a web api. but the UriBuilder
is adding these characters %u200b
to the beginning of a parameter.
here is my method:-
public string Add(string title, string account,string site,string description)
{
XmlDocument doc = new XmlDocument();
using (var client = new WebClient())
{
var query = HttpUtility.ParseQueryString(string.Empty);
query["account"] = account;
query["site"] = site;
query["title"] = title;
query["description"] = description;
string apiurl = System.Web.Configuration.WebConfigurationManager.AppSettings["ApiURL"];
var url = new UriBuilder(apiurl);
url.Query = query.ToString();
string xml = client.DownloadString(url.ToString());
doc.LoadXml(xml);
now the site
parameter will be passed to the method as Manchester (MAN)
but the final query will have the parameter with %u200b
added to it as follow:-
https://****?account=ABC&site=%u200bManchester+(MAN)&title=ABCDE
so can anyone advice on this please? why the UriBuilder
is adding %u200b
to the parameter ?? now the value i am passing is actually a drop-down option, and it is rendered correctly as follow + if i chose another option for the site name i will not face the problem:-