linux-packaging-mono/mcs/class/System.Web.Mvc3/Mvc/AjaxRequestExtensions.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

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"));
}
}
}