My object (class) is displayed in the browser as the page content. What to do, so that the browser offers to download a text file, in which was the contents of my object?

DataContractJsonSerializer jsonFormatter = new DataContractJsonSerializer(typeof(IndexBPC)); jsonFormatter.WriteObject(memStream, jsonResp); HttpClient.JsonArr = memStream.ToArray();//из потока помещаю в массив байт response.ContentLength64 = HttpClient.JsonArr.Length;// получаем поток ответа Stream output = response.OutputStream;// пишем в него ответ output.Write(HttpClient.JsonArr, 0, HttpClient.JsonArr.Length); 

I don’t consider options using WebInvoke yet.

    0