when i am using Request.IsAjaxRequest(). i am not able to return view(). please check below code. this is Action.
public ActionResult Index()
{
if (!Request.IsAjaxRequest()) {
return View("ajexview");
}
return view("About");
}
this is view
<script>
$(function () {
$("button").click(function () {
var car = { Make: 'Audi', Model: 'A4 Avant', Color: 'Black', Registered: 2013 };
$.ajax({
type: "POST",
url: "/home/index/",
data: car,
datatype: "html",
success: function (data) {
$('#result').html(data);
}
});
});
});
<button>Click me</button>
when i am posting about view is not able to return