WebMethod:
[WebMethod]
public static string[] GetLikes(int Id)
{
List<Like> Likes = Like.GetById(Id, false);
string[] Senders = new string[Likes.Count];
for (int i = 0; i < Likes.Count; i++)
{
Senders[i] = Likes[i].Sender;
}
return Senders;
}
jQuery:
$(".StreamLike").live("mouseover", function () {
var Id = $(this).parent().parent().find(".StreamIndex").html();
alert(Id);
$.ajax({
type: 'POST',
url: 'Default.aspx/GetLikes',
data: JSON.stringify({ "Id": Id }),
contentType: 'application/json; charset=utf-8',
dataType: 'json',
success: LikesSuccess,
error: LikesError
});
});
issue img http://www.taaraf.com/issue.png
Id is passed from JavaScript code as 338 correctly. Why does it show as 152? This isn’t allowing me to get the proper data.
Ideas?
Id is displayed in hexadecimal notation (as starts with 0x), 0x152 is equal to 338.