且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

WebService中的Response.Write()

更新时间:2023-12-05 22:40:40

这对我有用:

[WebMethod]
[ScriptMethod(ResponseFormat = ResponseFormat.Json)]
public void ReturnExactValueFromWebMethod(string AuthCode)
{
    string r = "return my exact response without ASP.NET added junk";
    HttpContext.Current.Response.BufferOutput = true;
    HttpContext.Current.Response.Write(r);
    HttpContext.Current.Response.Flush();
}