One important thing to remember about Javascript variables is that they are limited to the client-side, making them inaccessible server-side from code-behind. In order to utilize these variables on the server-side, you must find a way to store the value where the server can retrieve it.
There are various approaches you can take, but here's a suggestion: create a hidden field to securely hold the value, assign an id to the field, and add the runat="server"
attribute (this makes it accessible from the server-side). Then update your javascript code to fill this hidden field with the desired value.
Hidden field:
<asp:HiddenField id="SomeUniqueID" runat="server"/>
Javascript (without JQuery):
document.getElementById('<%= SomeUniqueID.ClientID %>').setAttribute("value", myJSONObject);
Javascript (with JQuery):
$('#<%= SomeUniqueID.ClientID %>').val(myJSONObject);