본문 바로가기
c#

<string xmlns="http://tempuri.org/"> </string> 없애기

by [김경민]™ ┌(  ̄∇ ̄)┘™ 2022. 6. 15.
728x90

[WebMethod(EnableSession = true)]

[ScriptMethod(ResponseFormat = ResponseFormat.Json)]

public void function()

{

            HttpContext.Current.Response.ContentType = "application/json"; // error on line 1 at column 1: document is empty
            string result = new JavaScriptSerializer().Serialize(new { result = list });
            HttpContext.Current.Response.Write(result);

}

 

 

 

 

728x90

댓글