我正在寻找一种方法或方法,以便在他进入网站时向网站访问者提供多个html文件。
喜欢:
Response.TransmitFile("index1.html");
Response.TransmitFile("index2.html");
Response.TransmitFile("index3.html");
Response.TransmitFile("index4.html");
Response.TransmitFile("index5.html");
我已经浏览了AspNetCore文档,但没有找到任何合理的信息。
任何帮助赞赏。
如果我了解您的目标,您基本上是在用户点击网站时让网站打开多个网址。在问题中,您指定“以HTML格式显示”,我假设您的意思是实际由浏览器呈现,而不是仅仅下载文件。
在这种情况下,我认为您唯一真正的选择是在View页面上使用JavaScript来打开新窗口。以下是使用您在上面指定的相同URL的示例
<script type="text/javascript">
window.onload = function() {
window.open("index1.html", "_blank");
window.open("index2.html", "_blank");
window.open("index3.html", "_blank");
window.open("index4.html", "_blank");
window.open("index5.html", "_blank");
}
</script>
使用这种方法的一些注意事项和警告: