I have an iframe which uses a Url.Action to open a PDF from an action controller. Is it possible to open this PDF on a certain page? Determined by a value in the model e.g. @Model.FilePage
iframe:
<iframe width="700" height="1600" src="@Url.Action("OpenPDF", new { id = 8 })"></iframe>
controller action:
public ActionResult OpenPDF(int? id)
{
CompletedCamp completedCamp = db.CompletedCamps.Find(id);
string filepath = Server.MapPath(Path.Combine("~/Surveys/" + completedCamp.SurveyName));
return File(filepath, "application/pdf");
}