I have serialized data into this form"
string json1 = [{"id":1,"col1":"11","col2":"22","col3":"33"}]
ScriptManager.RegisterClientScriptBlock(this, this.GetType(), "javascript", "Javascript:GetDateTime(" + json1 + ");", true);
How do I change the format of json1 so I do not get this error:
"Error Code: Status: [object Object] Ex: error"
jQuery Ajax
<script type="text/javascript src="http:
<script type="text/javascript">
function GetDateTime(json1) {
$.ajax
({
type: "POST",
url: "Default.aspx/GetServerDateTime",
data: json1,
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (result) {
alert(result.d);
},
error: function (status, ex) {
alert("Error Code: Status: " + status + " Ex: " + ex);
}
});
}
</script>