protected override void OnLoad(EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Clear(); base.OnLoad(e); string action = Request.QueryString["a"]; if (!string.IsNullOrEmpty(action)) { ProcessUtilRequest(action); ProcessNormalRequest(action); } string xml = Request.Form["xml"]; if (string.IsNullOrEmpty(xml)) { xml = Request.QueryString["xml"]; } if (!string.IsNullOrEmpty(xml)) { JsRequest r = xml.FromXml<JsRequest>(); HandleJsRequest(r); } else if (string.IsNullOrEmpty(action)) { JsRequest r = new JsRequest(); r.Methods.Add(new Method { Name = "Content" }); r.Methods[0].Params.Add(new Param { Name = "Arg1", Value = "a" }); r.Methods[0].Params.Add(new Param { Name = "Arg2", Value = "b" }); Response.Write(r.ToXml()); } AuthCodePage.Update(); Response.End(); }
protected override void OnLoad(EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Clear(); base.OnLoad(e); string action = Request.QueryString["a"]; if (!string.IsNullOrEmpty(action)) { if (string.Equals(action, "util", StringComparison.OrdinalIgnoreCase)) { string type = Request.QueryString["t"]; if (!string.IsNullOrEmpty(type)) { if ("Escape".Equals(type)) { Response.Write("<textarea id='box' style='width:800px; height:500px;'></textarea><br /><script>var b = document.getElementById('box');</script><input type='button' onmousedown='box.value = unescape(box.value);' value='UnEscape' /><input type='button' onmousedown='box.value = escape(box.value);' value='Escape' />"); Response.End(); } } } JsRequest r = new JsRequest(); string[] actions = action.Split(','); foreach (string a in actions) { Method m = r.AddMethod(a); if (!string.IsNullOrEmpty(a)) { string param = Request.QueryString[a]; if (!string.IsNullOrEmpty(param)) { string[] args = param.Split(','); foreach (string i in args) { m.AddParam(i); } } } } HandleJsRequest(r); } string xml = Request.Form["xml"]; if (!string.IsNullOrEmpty(xml)) { JsRequest r = xml.FromXml<JsRequest>(); HandleJsRequest(r); } else if (string.IsNullOrEmpty(action)) { JsRequest r = new JsRequest(); r.Methods.Add(new Method { Name = "GetData" }); r.Methods[0].Params.Add(new Param { Name = "Arg1", Value = "a" }); r.Methods[0].Params.Add(new Param { Name = "Arg2", Value = "b" }); Response.Write(r.ToXml()); } AuthCodePage.Update(); Response.End(); }
protected override void OnLoad(EventArgs e) { Response.Cache.SetCacheability(HttpCacheability.NoCache); Response.Clear(); base.OnLoad(e); string action = Request.QueryString["a"]; if (!string.IsNullOrEmpty(action)) { ProcessUtilRequest(action); ProcessNormalRequest(action); } bool processed = ProcessJsonRequest() || ProcessXmlRequest(); if (!processed && string.IsNullOrEmpty(action)) { JsRequest r = new JsRequest(); r.Methods.Add(new Method { Name = "Content" }); r.Methods[0].Params.Add(new Param { Name = "Arg1", Value = "a" }); r.Methods[0].Params.Add(new Param { Name = "Arg2", Value = "b" }); Response.Write(r.ToXml()); } AuthCodePage.Update(); Response.End(); }