Using ajax I'm receiving on asp.net mvc controller action certain string. Based on that string value I want to render partial view.
public ActionResult GetTabData(string activeTab)
{
string viewName = String.Empty;
switch (activeTab)
{
case "all":
viewName = "_AllPartial";
break;
case "one":
viewName = "_OnePartial";
break;
case "two":
viewName = "_TwoPartial";
default:
viewName = "_AllPartial";
break;
}
return PartialView("/Home/"+viewName);
}
All partial views are stored inside Views/Home directory but I'm constantly getting error that partial view cannot be found
The partial view '/Home/_AllPartial' was not found or no view engine supports the searched locations. The following locations were searched:
/Home/_AllPartial