나는 PDF를 보여주는 인쇄 방법을 가지고 있는데, 새 창에서 보여주고 싶습니다!새 페이지/창에 PDF를 표시하고 싶습니까?
이것은 내가 새 페이지, 탭, 창에 표시하고자하는 것입니다!
return File(arrStream, "application/pdf");
내 인쇄 방법 :
public ActionResult Print(int id) // sales contract Id
{
ParameterFields paramFields = CreateParameterFields(id); // pass the id of the contract
// Save the report run details
Guid reportRunId;
SaveReportRunDetails(paramFields, out reportRunId);
try
{
<<< Print code >>>
//Open a new page on this return
return File(arrStream, "application/pdf");
}
catch (Exception err)
{
ViewBag.ErrorMessage = err.Message;
return RedirectToAction("Edit", new { id = id, error = err.Message });
}
}
이것은 컨트롤러이며, 내가 링크에 있었다면 난, 단절 측 코드와 클라이언트 측 스크립트를 혼합 할 수 이 컨트롤러를 가리킨 다음 내 오류조차도 새 페이지에 표시됩니다. 이는 사용자에게 좋지 않을 것입니다.
어떻게하면 목표를 달성 할 수 있습니까?
어쩌면 액션 메소드가 FileStreamResult을 반환해야 해결해야합니까? –
그게 무슨 뜻일까요? 제발 – Pomster