コードビハインドファイルを使用してASMXファイルを作成しました。正常に動作していますが、XMLを出力しています。
ただし、JSONを出力するために必要です。ResponseFormat構成が機能していないようです。私のコードビハインドは次のとおりです。
[System.Web.Script.Services.ScriptService]
public class _default : System.Web.Services.WebService {
[WebMethod]
[ScriptMethod(UseHttpGet = true,ResponseFormat = ResponseFormat.Json)]
public string[] UserDetails()
{
return new string[] { "abc", "def" };
}
}