Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/url/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
File 如何在剑道超链接上添加根url_File_Url_Download_Kendo Grid - Fatal编程技术网

File 如何在剑道超链接上添加根url

File 如何在剑道超链接上添加根url,file,url,download,kendo-grid,File,Url,Download,Kendo Grid,我有一个剑道网格,它有一个下载文件的链接,在我的本地机器上运行良好。但是,在我的代码发布/部署到服务器后,当您单击时,它不会下载文件。但是,如果我从浏览器手动放置根目录,下面的错误就是我得到的服务器错误 错误:404-找不到文件或目录。 我已经试着读了这篇文章并申请了我的案例,但没有成功。我不确定我是否做得不对 我的下载链接 columns.Template(@<text> @Html.ActionLink(@item.ID.ToStr

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

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

我已经试着读了这篇文章并申请了我的案例,但没有成功。我不确定我是否做得不对

我的下载链接

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");
columns.Template(@
@ActionLink(@item.ID.ToString(),“DownloadIndex”,“controllerName”,新的{ID=@item.ID})
)

.ClientTemplate(“经过几个小时的研究…我设法找到了一个解决问题的方法

如果您使用的不是本地,默认情况下,它会指向您的本地主机,该主机变成了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");    
columns.Template(@
@ActionLink(@item.ID.ToString(),“DownloadIndex”,“Poss”,new{ID=@item.ID})
)
.ClientTemplate(“”)
.标题(“下载”);

经过几个小时的研究……我终于找到了解决问题的办法

如果您使用的不是本地,默认情况下,它会指向您的本地主机,该主机变成了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");    
columns.Template(@
@ActionLink(@item.ID.ToString(),“DownloadIndex”,“Poss”,new{ID=@item.ID})
)
.ClientTemplate(“”)
.标题(“下载”);