ASP.Net MVC:对的RenderPartial静态HTML文件 [英] ASP.Net MVC: RenderPartial for a static HTML file
本文介绍了ASP.Net MVC:对的RenderPartial静态HTML文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我敢肯定,这是一个简单的一个你最...什么是注入(从光盘上一个HTML文件)的静态HTML到视图的最佳方式?
我要沿着这个线的东西:
<%= Html.RenderPartial(pathToMyHtmlFile)%GT;
解决方案
WriteFile的从响应对象可能做你想要什么:
<%Response.WriteFile(pathToMyHtmlFile); %GT;
I'm sure this is an easy one for most of you ... What is the best way to inject static HTML (from a html file on disc) into a View?
I want something along the lines of this:
<%= Html.RenderPartial(pathToMyHtmlFile) %>
解决方案
WriteFile from the Response object might do what you want:
<% Response.WriteFile(pathToMyHtmlFile); %>
这篇关于ASP.Net MVC:对的RenderPartial静态HTML文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文