I am developing an ASP.NET site in which, based on a certain logic, I get output in a specific format on http://localhost/menu.aspx?callback=example
In the above url, I get output in a specific format foo({"1":"Jeff","2":"Mic","5":"Mark"});with this little code.
outputText += Convert.ToString(k.GetValue(0));
for (Int32 i = 1; i < k.Length; i++)
{
outputText += "," + Convert.ToString(k.GetValue(i));
}
//
outputText += "}" +");";
Response.Write(outputText);
Here is the full code menu.aspx.cs. http://pastebin.com/dxbNmais
But this is the html output on the page menu.aspx. But my requirement is that the HTTP response should be json too. Please help in getting this JSON output. Not only have I not tried JSON before, but I'm not too professional in ASP.NET.
source
share