With a bat: I'm new to using asp.net mvc 4.
I have an action that creates an excel file and then converts it to PDF.
From view
@Html.ActionLink("Generate Invoice", "genInvoice", new { id = item.invoiceID }) |
Act:
public ActionResult genInvoice(int id = 0) { var invoiceItems = from k in db.InvoiceItems where k.invoiceID == id select k; string invoiceClient = (from kk in db.Invoices where kk.invoiceID == id select kk.clientName).Single(); invoiceClient = invoiceClient + "_" + DateTime.Now.ToString("ddd dd MMM yyyy hhTmm"); string websitePath = Request.PhysicalApplicationPath; string pathName = websitePath + "\\" + invoiceClient ; generateInvoice(invoiceItems, pathName + ".xlsx", id); convertToPDF(pathName, invoiceClient);
Now I want to end up loading the PDF file, and then return to the index view. It goes to the Index view, prints html, etc., but then the window remains as a white screen with the URL: / Invoice / genInvoice / 1
Any idea how I can do this? (Returning to the Index view after creating the PDF files, also loading it)
source share