After loading a CSV file from Index.cshtml via:
@using (Ajax.BeginForm("LoadCSV", null, new AjaxOptions { HttpMethod = "POST" }, new { enctype = @"multipart/form-data" }))
{
<input type="file" id="fuLoadCSV" name="fuLoadCSV" class="input" />
<input type="submit" id="btnLoadCSV" />
}
I am successfully capturing the csv data and converting it to a list of User object:
[HttpPost]
public ActionResult LoadCSV(HttpPostedFileBase fuLoadCSV)
{
string fileName = Path.GetFileName(fuLoadCSV.FileName);
fuLoadCSV.SaveAs(Server.MapPath("~/FileUploads/" + fileName));
List<User> list = GetUsersFromCSV(Server.MapPath("~/FileUploads/" + fileName));
File.Delete(Server.MapPath("~/FileUploads/" + fileName));
return PartialView(list);
}
These results are being sent to the partial view just fine. Now I want this partial view with these results to display inside a jQuery dialog. How can I make this happen? I've opened a jQuery dialog plenty of times client side from the Index view, but I have no idea how to do it from the controller.