You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
609 B
C#
25 lines
609 B
C#
using System.Web.Mvc;
|
|
|
|
namespace DSWeb.MvcShipping.Helper
|
|
{
|
|
public class JsonRequestBehaviorAttribute : ActionFilterAttribute
|
|
{
|
|
private JsonRequestBehavior Behavior { get; set; }
|
|
|
|
public JsonRequestBehaviorAttribute()
|
|
{
|
|
Behavior = JsonRequestBehavior.AllowGet;
|
|
}
|
|
|
|
public override void OnResultExecuting(ResultExecutingContext filterContext)
|
|
{
|
|
var result = filterContext.Result as JsonResult;
|
|
|
|
if (result != null)
|
|
{
|
|
result.JsonRequestBehavior = Behavior;
|
|
}
|
|
}
|
|
|
|
}
|
|
} |