To learn more about the new exciting Asp.Net-5 framework, I\'m trying to build a web application using the newly released Visual Studio 2015 CTP-6.
Most things looks
For those who are working on ASP.Net Core
HttpContext.Request.Headers["X-Requested-With"] == "XMLHttpRequest";
Example
Controller.cs
bool isAjax = HttpContext.Request.Headers["X-Requested-With"] == "XMLHttpRequest";
if (isAjax)
return Json(new { redirectTo = Url.Action("Index", "ControllerAction") });
else
return RedirectToAction("Index", "ControllerAction");