In a small asp.net webclient I have the following Ajax-call.
$.ajax({
type: "GET",
url: "Search.aspx?action=GetDocumentInfoByChronicleId&" + querystring
})
.success(function (msg) {
$("#documentcontent").html(msg);
})
The querystring
works for default characters but appears to be non-working when using special characters (see example below)
objectId=09028139800c59e3&Db=DIV_Firm <== Works
objectId=090281>>773c5983&Db=DIV_Firm <== Non Working
Based on this (and many more posts on SO i opted to change my ajax-calls as follows (EncodeUriComponent
). But none appear to be working (even with the original querystring).
Could someone point out to me what i'm exactly doing wrong?
$.ajax({
type: "GET",
url: "Search.aspx?action=GetDocumentInfoByChronicleId&" + encodeURIComponent(querystring)
})
.success(function (msg) {
$("#documentcontent").html(msg);
})
Note: EncodeUri
appears to be working though. But i'd prefer to use EncodeUriComponent