using System.Net; using System.Web.SessionState; namespace handlerTest.UI.Handler { public class AuthHandler : IHttpHandler, IRequiresSessionState { private static ILog log = LogManager.GetLogger(typeof(AuthHandler)); public void ProcessRequest(HttpContext context) { string req = new System.IO.StreamReader(context.Request.InputStream).ReadToEnd(); context.Response.ContentType = "application/json; charset=UTF-8" JObject jo = JObject.Parse(req); string sessionType = (string)jo["SessionType"]; string par = (string)jo[param]; string[] paramArray = null; if (par.Contains(,)) { paramArray = par.Split(,); } else { paramArray = new string[1]; paramArray[0] = par; } //context.Response.Cache.SetCacheability(HttpCacheability.NoCache); if (sessionType == "1") { string loggedIntime = DateTime.Now.ToString("dd-MMM-yyy/hh:mm:ss"); context.Session.Add("TEST", par); } else { }
$.ajax({ url: 'Handler/AuthHandler.ashx', data: myData, dataType: 'text', type: 'POST', cache: false, timeout: 120000,
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)