C# MVC: Chrome using the action name to set inline PDF title

前端 未结 4 649
时光说笑
时光说笑 2021-01-11 10:42

I have an action who displays a PDF in a new browser tab.

    public ActionResult Print()
    {
        var cd = new ContentDisposition
        {
                    


        
4条回答
  •  既然无缘
    2021-01-11 11:28

    To the action method pass parameter of the file name and make sure parameter name is 'id'.

    View code:

    Url.Action("Print", "Controller", new { id = "filename", area = "Area" }), new { @target = "_blank" }

提交回复
热议问题