I have a code:
Session[“timestamp”] has a byte array in it coming using LInq to Entity
Now when i call this function it throws an error
The web service has a signature like:
[WebMethod]
public string IsRowChanged(int en_id , byte[] timestamp)
{
}
If I replace byte[] with string everywhere it works.
$.ajax({
type: "POST",
url: "UpdateEntityService.asmx/IsRowChanged",
data: "{ 'en_id':'" + '<%= Request.QueryString["entity_id"] == null ? "1" : Request.QueryString["entity_id"] %>' + "' , 'timestamp': '" + '<%= (Session["timestamp"]) %>' + "' }",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
var result = msg.d;
if (result == "0") {
save_valid();
$.prompt("Data Saved Sucessfully");
}
else {
$.prompt("Data Concurrency Error! Reload the Page.. by pressing F5");
}
},
error: function (XMLHttpRequest, textStatus, errorThrown) {
alert(textStatus);
alert(textStatus);
alert(errorThrown);
}
});
Any help is appreciated.
You should Base encode binary data and convert it back to byte[] at serverside.