a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
15 lines
473 B
C#
15 lines
473 B
C#
namespace System.Web.Mvc {
|
|
using System;
|
|
|
|
public static class AjaxRequestExtensions {
|
|
|
|
public static bool IsAjaxRequest(this HttpRequestBase request) {
|
|
if (request == null) {
|
|
throw new ArgumentNullException("request");
|
|
}
|
|
|
|
return (request["X-Requested-With"] == "XMLHttpRequest") || ((request.Headers != null) && (request.Headers["X-Requested-With"] == "XMLHttpRequest"));
|
|
}
|
|
}
|
|
}
|