Method IsAjax
IsAjax(HttpRequest)
Verifies whether the request has been initiated via AJAX by checking whether the "X-Requested-With"
header is set to "XMLHttpRequest".
Declaration
public static bool IsAjax(this HttpRequest request)
Parameters
Type | Name | Description |
---|---|---|
Microsoft.AspNetCore.Http.HttpRequest | request | The Microsoft.AspNetCore.Http.HttpRequest instance to verify. |
Returns
Type | Description |
---|---|
Boolean | true , if the request was initiated by AJAX, otherwise false . |