jquery - Ajax.IsAjaxRequest() always returns false? -
in controller class code "if(request.isajaxrequest())" returns false... can me figure out? if use ajax.beginform in cshtml page , not use jquery file returns true. this cshtml file <form method="get" action="@url.action("index")" data-otf-ajax="true" data-otf-target="#listofdata"> <input type="search" name="searchterm"/> <input type="submit" value="search"/> this controller logic: public actionresult index( string searchterm) { var departments = db.departments.include(d => d.administrator); if(request.isajaxrequest()) { if (searchterm != null) { var departments2 = db.departments.where(x => x.name.contains(searchterm)); return partialview("_department", departments2.tolist()); } } return view(departments.tolist())...