日期:2014-05-17 浏览次数:20413 次
$.ajax({ type: "POST", url: "ValueChange.ashx", data: { sm: logInfo }, contentType: "application/text; charset=utf-8", success: function() { var session = '<%=Session["aa"]%>'; alert(session); return true; } });
using System; using System.Collections; using System.Data; using System.Linq; using System.Web; using System.Web.Services; using System.Web.Services.Protocols; using System.Xml.Linq; using System.Web.SessionState; namespace ValueChangePro { /// <summary> /// $codebehindclassname$ 的摘要说明 /// </summary> [WebService(Namespace = "http://tempuri.org/")] [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] public class Handler1 : IHttpHandler, IRequiresSessionState { public void ProcessRequest(HttpContext context) { context.Response.ContentType = "text/plain"; var log = context.Request.QueryString["sm"]; context.Session["aa"] = log; } public bool IsReusable { get { return false; } } } }