I have a Ajax
request that gets the data I need from a WebMethod
. The problem is that the parameter used for the request is "arriving" truncated in WebMethod
the length of the parameter is 44 digits.
Parameter sent: 31161102996615000145550000000413281487877818
.
How's it coming: 3.1161102996615E+43
Ajax code:
var valorCampo= $(this).attr('data-clipboard-text');
var content = "parametroConsulta=" + encodeURIComponent(valorCampo);
$.ajax({
type: "GET",
dataType: 'json',
async: false,
contentType: "application/json; charset=utf-8",
url: "myPage.aspx/ObtenhaDados",
data: content,
success: function (data) { dadosObtidos(data); },
error: function (data) { falhaConsulta(data); }
});
WebMethod
:
[WebMethod]
[ScriptMethod(UseHttpGet = true, ResponseFormat = ResponseFormat.Json, XmlSerializeString = false)]
public static DadosPessoais ObtenhaDados(string valoPesquisa)
{ .... }
Url displayed in FireBug:
http://localhost:61187/ps/myPage.aspx/ObtenhaDados?valoPesquisa=31161102996615000145550000000413281487877818