jsonp

$(function() {$.ajax({url: "http://****.***.com/***.html?callback=?",dataType: "jsonp",jsonp: 'callback'});});

 

  public ContentResult ***()
        {
            int state = 0;
            if (HttpContext.User.Identity.IsAuthenticated && HttpContext.Request.Url.ToString().IndexOf(".***.com")!=-1)
            {
                ConsultInfo c_info = consultService.GetConsultByUser(HttpContext.User.Identity.Name);
                if (c_info != null)
                {
                    state = consultService.SetLastActiveTime(" Id=" + c_info.Id.ToString() + " ");
                }
            }
            string call = HttpContext.Request.QueryString["callback"];
            if (!string.IsNullOrEmpty(call))
               return Content(call + "({state:" + state.ToString() + "})");
            else
                return Content("{ state = "+state.ToString()+" }");
        }

posted on 2010-08-09 14:22  jianshaohui  阅读(184)  评论(0编辑  收藏  举报

导航