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

Popular posts from this blog

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -

Trying to import CSV file to a SQL Server database using asp.net and c# - can't find what I'm missing -