i wanna call C# action using Ajax, My question is how to redirect my action to the result page after the sucess of the function i tried :
$.ajax({
type: 'Get',
url: "/OffreLocation/SearchOffer",
data: {
quartier: Quartier,
superficieMin: SuperficieMin,
superficieMax: SuperficieMax,
budgetMin: BudgetMin,
budgetMax: BudgetMax
},
success: function (response) {
window.location.href = "/Home/SearchResult";
}
});
but it returns the actual View !!
my action :
[HttpGet]
public ActionResult SearchOffer(int quartier, int superficieMin, int superficieMax, int budgetMin, int budgetMax)
{
List<OffreLocation> SearchedOffer = db.PublicationSet.OfType<OffreLocation>().Where( model => model.QuartierQuartier_Id == quartier && model.OffreLocation_Superficie > superficieMin && model.OffreLocation_Superficie < superficieMax).ToList();
return RedirectToAction("SearchResult", "Home", SearchedOffer);
}
any help !