Encodes a URL string. The UrlEncode method can be used to encode the entire URL, including query-string values.