【问题标题】:How to add root url on kendo hyperlink如何在剑道超链接上添加根网址
【发布时间】:2017-01-10 10:04:27
【问题描述】:

我有一个剑道网格,它有一个下载文件的链接,它在我的本地机器上运行良好。但是,在我的代码被发布/部署到服务器后,当您单击它时它不会下载文件。但是如果我从浏览器手动放置根目录,它的工作原理是我得到的错误服务器错误

错误:404 - 找不到文件或目录。

我已尝试阅读此solution 并申请我的案例,但没有成功。不知道是不是做错了。

我的下载链接

columns.Template(@<text>
                        @Html.ActionLink(@item.ID.ToString(), "DownloadIndex", "controllerName", new { ID = @item.ID })
                        </text>)
                         .ClientTemplate("<href=/controllerName/DownloadIndex?ID=#= ID#'>Download />").Width(100)
                          .Title("Download");

【问题讨论】:

    标签: file url download kendo-grid


    【解决方案1】:

    经过几个小时的研究……我设法找到了解决问题的方法。

    如果您不在本地工作,默认情况下它指向您的本地主机,变成 http 并且您将能够下载文件,但是,如果您在服务器上工作,则需要指定它是一个服务器“https

    完整的解决方案

    columns.Template(@<text>
                            @Html.ActionLink(@item.ID.ToString(), "DownloadIndex", "Poss", new { ID = @item.ID })
                            </text>)
                              .ClientTemplate("<a href='" +Url.Action("DownloadIndex", "controllerName",null,"https") + "?ID=#= ID#'" + ">Downloading</a>")
            .Title("Download");    
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-03-14
      • 2011-06-02
      • 1970-01-01
      • 2023-03-05
      相关资源
      最近更新 更多