I have generated a partial view inside bootstrap modal popup which searches for the data from textbox on click of search Button within that modal popup.
I am using Ajax.BeginForm to send the data. But still my controller doesn't get the data i am paasing. I am using @Html.TextBoxFor in the view.(MVC)
Modal Popup View
@using (Html.BeginForm(FormMethod.Post))
{
@using (Ajax.BeginForm("_ModalSearch", "controller", new AjaxOptions() { UpdateTargetId = "Search" }))
{
@using (Html.BeginFormGroup(m => m.CompanyName))
{
@Html.TextBoxFor(m => m.CompanyName)
}
}
My Controller
public ActionResult _ModalSearch()
{
var model = new CompanyModel();
RefreshCompanyModel();
return PartialView("_OperatorSearch",model);
}
[HttpPost]
public ActionResult _ModalSearch(CompanyModel model)
{
var companyResults = GetCompanyResults(model);
return PartialView("_OperatorSearch", companyResults);
}
so when i am inserting any value into textbox from modal popup view, it should pass to controller via model which is not working here.

Answers
Know the answer? Post it. Somebody with the same question will find it here.