Welcome Guest Search | Active Topics | Sign In | Register

MVC to PDF always downloads file Options
Moshe
Posted: Friday, July 19, 2013 12:55:17 PM
Rank: Newbie
Groups: Member

Joined: 7/19/2013
Posts: 1
I would like the PDF file to appear in the browser. Both Chrome and IE are downloading the file. My action looks like this:

Code: C#
public class PDFController : Controller
    {
        [EO.Pdf.Mvc4.RenderAsPDF]
        [HttpGet]
        public ActionResult Session(int sessionID)
        {
            Session session = Database.GetSession(sessionID);

            if (session == null) return new HttpNotFoundResult();

            return View(new List<Session>() { session });
        }


    }
eo_support
Posted: Friday, July 19, 2013 2:12:28 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,195
Hi,

You would set ResultAsDownload to false on your RenderAsPDF attribute:

Code: C#
[EO.Pdf.Mvc4.RenderAsPDF(ResultAsDownload=false)]


Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.