Link to home
Start Free TrialLog in
Avatar of Pixie_IT
Pixie_IT

asked on

encode url string C#

How do i use Server.UrlEncode to firstly remove a '~' and add additional text to the URL? using C#
Avatar of sachinpatil10d
sachinpatil10d
Flag of India image

not clear about you question
some thing like this would work
String MyURL;
MyURL = "http://www.Testsite.com/testPage.aspx?title=" + Server.UrlEncode("samples~".Replace("~", "additional text"));

Response.Write("<a href=" + MyURL + "> samples </a>");

Open in new window

Avatar of johnchapmansc
johnchapmansc

String MyURL;
MyURL = "http://www.contoso.com/articles.aspx?title=" + Server.UrlEncode("ASP.NET Examples");

Response.Write("<a href=" + MyURL + "> ASP.NET Examples </a>");
Avatar of nishant joshi
string url=System.Web.HttpUtility.UrlDecode("http:\\www.google.com") + "Append something something";
ASKER CERTIFIED SOLUTION
Avatar of Pixie_IT
Pixie_IT

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Pixie_IT

ASKER

Unfortunately the wording of the question may have resulted in not gettign the answer we required.