Skip to content

Commit f385159

Browse files
committed
validate is ajax request for MVC
1 parent a65b81c commit f385159

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/JQDT.MVC/JQDataTableAttribute.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@ public override void OnActionExecuted(ActionExecutedContext filterContext)
2121
{
2222
try
2323
{
24+
if (!filterContext.RequestContext.HttpContext.Request.IsAjaxRequest())
25+
{
26+
filterContext.Result = new HttpNotFoundResult();
27+
return;
28+
}
29+
2430
this.PerformOnActionExecuted(filterContext);
2531
}
2632
catch (Exception ex)

0 commit comments

Comments
 (0)