12345678910111213141516171819202122232425262728293031323334353637 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Web;
- using System.Web.Mvc;
- namespace EMIS.Web.Controls
- {
- public class JSONPResult : JsonResult
- {
- public JSONPResult()
- {
- JsonRequestBehavior = JsonRequestBehavior.AllowGet;
- }
- public string Callback { get; set; }
-
-
-
-
- public override void ExecuteResult(ControllerContext context)
- {
- var httpContext = context.HttpContext;
- var callBack = Callback;
- if (string.IsNullOrWhiteSpace(callBack))
- callBack = httpContext.Request["callback"];
-
- httpContext.Response.Write(callBack + "(");
- httpContext.Response.Write(Data);
- httpContext.Response.Write(");");
- }
- }
- }
|