ASP.Net MVC:用于静态HTML文件的RenderPartial

Rob*_*ool 10 asp.net-mvc

我相信对于大多数人来说这是一个简单的方法...将静态HTML(从光盘上的html文件)注入视图的最佳方法是什么?

我想要的东西是这样的:

<%= Html.RenderPartial(pathToMyHtmlFile) %>
Run Code Online (Sandbox Code Playgroud)

Jon*_*cto 16

Response对象中的WriteFile可能会执行您想要的操作:

<% Response.WriteFile(pathToMyHtmlFile); %>
Run Code Online (Sandbox Code Playgroud)