Hello, I have the following in my view:
@Html.TextBoxFor(m => m.LastName, new { @class = "filterInput" })
The user supplies a value and clicks:
@Html.ActionLink("Export to Excel", "ExportToExcel")
Which gets data from the model and then exports the data to excel:
public void ExportToExcel(PortalAccountMappingModel model)
{
var data = model.GetExport();
ExportHelper.ExportExcel();
}
In the model.GetExport(); I pass the value to filter data and return what I need to export.
But the model is not being updated to reflect what the user entered in the TextBoxFor so my data does not get filtered.
Why is that? Is it because I'm not doing an ActionResult and the view never updates the model when the user enters data into the TextBoxFor?
Our community of experts have been thoroughly vetted for their expertise and industry experience.