Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XmlHttpRequest with asp.net

I try to send a get request to my ashx file.But I have character problem.
Problem is when I send request by firefox or crome no problem but when try to send with IE I cant
get what I send. I send "Ç" character but on server side i cant get it.

myRequest.open("GET", "/Search.ashx?SearchText=" + search + "", true);
myRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
myRequest.send(null);
like image 938
Just Ersoy Avatar asked Jul 05 '26 18:07

Just Ersoy


1 Answers

It seems you haven't encoded 'search' string with encodeURIComponent function using javascript. On ashx side, you can use HttpUtility.HTMLDecode method to decode your string.

like image 135
Samil Avatar answered Jul 07 '26 08:07

Samil