I have method, that return FileContentResult:
public FileContentResult fileStream(string EAN)
{
//Finding byte[] of PDF
byte[] pdf = findPDF(EAN);
return new FileContentResult(pdf, "application/pdf");
}
And I use it in iframe:
<iframe src="@Url.Action("fileStream", "Approve", new { EAN = Model.ID_EAN })" frameborder="0"></iframe>
What should I return if pdf is null (FileContentResult is null). Now it shows Error page with controller name and controller action.