Am receiving a JSON object from webservice in C# using the below script
$.ajax({
type: "POST",
url: "Services/LogService.asmx/authenticateLogin",
data: "{'gopId':'" + txtGopId+ "'}",
contentType: "application/json; charset=utf-8",
success: function (response)
{
var k = $("#hidId").val(response.d);
window.location.replace("Pages/Reved.aspx?hid="+k+"");
},
error: function (xhr, status, error) {
DisplayError(xhr);
}
});
hidId is a hidden feild.
On sucess am forwarding the Object to another aspx page and trying to deserialize this on page_load
JavaScriptSerializer serializer = new JavaScriptSerializer();
userBO = serializer.Deserialize<UserBO>(Request["hid"]);
Am I doing some thing wrong? as iam facing this error: Invalid JSON primitive: object
UserBOand the content ofRequest["hid"]?Request["hid"]?