Hi I Want to Open a File as pdf but i also want to return my resluts on web page with the same action how would i do that. here is my code.
public JsonResult FindRecordings(SearchCriteria criteria) { if ( string.IsNullOrEmpty(criteria.OrderNumber) && string.IsNullOrEmpty(criteria.ReferenceId) && string.IsNullOrEmpty(criteria.ReferenceId2) && string.IsNullOrEmpty(criteria.LastName) && string.IsNullOrEmpty(criteria.Address)) { return Json("FAIL", "Please enter a value for the search field.", ""); } int companyId = (int)Session["user.company.id"]; IList order = _recordingRepo.GetOrders(criteria,companyId); if (order != null) { List listEditOrder = new List(); foreach (Order o in order.OrderBy(o=>o.Id)) { if (o.Recordings.Count > 0) { EditOrder editOrder = EditOrder.FromDbOrder(o, OrderDetail.Recordings); listEditOrder.Add(editOrder); } }
criteria.ReportFormat = "PDF";
FileContentResult fileResult = (FileContentResult)RecordingReport(criteria);
// I want to open my fileResult so that customer can see or save this file.
return Json("OK", "Recording(s) successfully found.", listEditOrder);
}
else
{
return Json("FAIL", "No Recordings Found.","");
}
}