public static IResponse Get(string transferMode, ContextSupport context) { if (string.IsNullOrEmpty(transferMode) || transferMode == "scriptTag") { return new JsonRespose(context); } else if (transferMode == "iframe") { return new JsonRespose(context, true); } else { return new NullResponse(); } }
public void ProcessRequest(HttpContext context) { ContextSupport cs = new ContextSupport(context); try { cs.ProcessRequest(); cs.Response.WriteResult(); cs.CompleteRequest(); } catch { throw new HttpException(500, "服务端异常"); } }
public JsonRespose(ContextSupport context, bool isIframe) { this.Context = context; this.isIframe = isIframe; if (isIframe) { prefixScriptNode = "<script type=\"text/javascript\">\r\n"; suffixScriptNode = "\r\n</script>"; ndwrVariableHost = "window.parent."; contentType = "text/html"; } }
public JsonRespose(ContextSupport context) { this.Context = context; }