I have a simple code that needs to return string in json using a browser.
[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public string FunctiGetJsononName(string str)
{
JavaScriptSerializer ser = new JavaScriptSerializer();
return ser.Serialize(str);
}
The output I get is json inside of xml. I want the json without the XML.
I can't use void method as well. Also, I am using framework 4.5.2 and empty template (I can't use anything else).