我想在新页面上显示我的 ActionResult 的返回?
下面的这个电话是我唯一无法在新页面上显示的电话?
谁能告诉我要添加什么才能做到这一点,我已经使用 Window.open 和按钮,但现在我有一个 RedirectToAction。
这是我想在新页面/窗口上显示的调用:
return RedirectToAction("Print", new { id = contractInstance.SalesContractId });
我已经使用此代码执行此操作的按钮:
window.open('Contract/Print/' + $(this).attr('id'));
Print actionResult 如下所示:
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 would also be a good answer :)!!!!!!!
return File(arrStream, "application/pdf");
}
catch (Exception err)
{
ViewBag.ErrorMessage = err.Message;
return RedirectToAction("Edit", new { id = id, error = err.Message });
}
}