예제 #1
0
 public void TestPassJSONDownload(TestDTO data)
 {
     Response.Clear();
     Response.AddHeader("Content-Disposition", "attachment; filename=" + "test.txt");
     Response.ContentType     = "text/xml";                            //"application/force-download";
     Response.Charset         = "windows-874";
     Response.ContentEncoding = System.Text.Encoding.GetEncoding(874); //System.Text.Encoding.GetEncoding("UTF-8");
     //System.Xml.Serialization.XmlSerializer x = new System.Xml.Serialization.XmlSerializer(data.GetType());
     //StringWriter sw = new StringWriter();
     //x.Serialize(sw, data);
     Response.Write(string.Format("{0},{1},{2}", data.id, data.description, data.startDate.ToString()));
     Response.End();
 }
예제 #2
0
        public string TestPassJSON(TestDTO data)
        {
            string s = "No Data Passed";

            if (data != null)
            {
                s = data.description;
                int detailCount = 0;
                if (data.detail != null)
                {
                    detailCount = data.detail.Count;
                }
                s += " with detail count:" + detailCount;
            }


            return(s);
        }