How to return Json result without double quotes?
-
03-07-2021 - |
题
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. ?
解决方案
Use the correct type for result
and you should get a non-string for the integer.
不隶属于 StackOverflow