1

I am calling a web service method which return boolean value in json. But on front end i am getting response true{"d":null}. {"d":null} is appending in response.

Following is my web service code

[WebMethod]
        public void CreateTeam(tblTeam team)
        {
            var result = BLL.Team.Add(team);
            Context.Response.Flush();
            Context.Response.Write(JsonConvert.SerializeObject(result));
        }

Solutions which i tried:

  • Add Context.Response.Flush();
  • Use JsonConvert instead of JavaScriptSerializer

But both are not worked. How can i solve this? Please help?

Hunzla Ali
  • 61
  • 1
  • 9

1 Answers1

0

As explain in below thread remove content type from ajax calling

ASP.NET AJAX returning JSON but not recognised as JSON

mkm2015
  • 24
  • 2