How to return Json result without double quotes?
-
03-07-2021 - |
Question
I use this action in controller:
public JsonResult DoSomething(int id )
{
char result = '0';
....
return this.Json( result, JsonRequestBehavior.AllowGet );
}
Results are in double quotes: "0", "1", "2" etc.
How can I get results without double quotes as 0, 1, 2 etc. ?
Solution
Use the correct type for result
and you should get a non-string for the integer.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow