0๐
If you were submitting a form
, the urleconding would be automatically applied. Since you are getting and sending the search query without form submission, just apply a javascript function to encode that fetched value:
this.queryParams.query = searchQuery ? encodeURI(searchQuery): null;
0๐
You can do like this.
Uri.EscapeUriString(request.Query)
Source:stackexchange.com