jquery - JSON posting data -
i have json data being added this:
{ "name": "ghngjnghj", "email": "jhjhj@jkbjvk.com", "message": "hjhjhj" }
but need format this:
jsoncallback( { "name": "ghngjnghj", "email": "jhjhj@jkbjvk.com", "message": "hjhjhj" } ); url: "post_json.aspx", data: $("#contact_form").serialize(),
also i'm using json.net in code behind
string json = jsonconvert.serializeobject(account, formatting.indented); file.writealltext(@"c:\inetpub\wwwroot\json\dotnet4b\test_file.json", json);
i had change string json so!
string json = "jsoncallback(\n" + jsonconvert.serializeobject(account, formatting.indented) + "\n);";
hth someone
Comments
Post a Comment