コード例 #1
0
        public new void ProcessRequest(HttpContext context)
        {
            Song.ViewData.Letter     p      = new Song.ViewData.Letter(context);
            Song.ViewData.DataResult result = Song.ViewData.ExecuteMethod.ExecToResult(p);

            string json = result.ToJson();

            context.Response.ContentType = "text/plain";
            context.Response.Write(json);
            context.Response.End();
        }
コード例 #2
0
ファイル: API.ashx.cs プロジェクト: zzti/LearningSystem
        public new void ProcessRequest(HttpContext context)
        {
            Song.ViewData.Letter     p      = new Song.ViewData.Letter(context);
            Song.ViewData.DataResult result = Song.ViewData.ExecuteMethod.ExecToResult(p);

            context.Response.ContentType = "text/plain";
            string resultTxt = "xml".Equals(p.ReturnType, StringComparison.CurrentCultureIgnoreCase) ? result.ToXml() : result.ToJson();

            //如果操作失败,则返回自定义状态码
            //if (!result.Success)
            //    context.Response.StatusCode = 405;
            context.Response.Write(resultTxt);
            context.Response.End();
        }